Inceptus.DiagramEngine.Contracts 1.2.0

dotnet add package Inceptus.DiagramEngine.Contracts --version 1.2.0
                    
NuGet\Install-Package Inceptus.DiagramEngine.Contracts -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Inceptus.DiagramEngine.Contracts" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Inceptus.DiagramEngine.Contracts" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Inceptus.DiagramEngine.Contracts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Inceptus.DiagramEngine.Contracts --version 1.2.0
                    
#r "nuget: Inceptus.DiagramEngine.Contracts, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Inceptus.DiagramEngine.Contracts@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Inceptus.DiagramEngine.Contracts&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Inceptus.DiagramEngine.Contracts&version=1.2.0
                    
Install as a Cake Tool

Inceptus Diagram Engine

A reusable BPMN modeler with immutable native documents and a standalone process presentation export. This README describes the 1.2.0 candidate, targeting net10.0, with SDK 10.0.403 for source builds. It adds passive text/SVG annotations, presentation refresh and application-owned Smart toolbar and popup actions. The source Demo provides Editable, ReadOnly and Simulation examples. Native document formats and editing restrictions remain unchanged; existing integrations remain editable by default. This documentation does not announce package availability.

Migration from DocumentEngine 0.x

Version 1.0.0 renamed the six engine packages, assemblies and namespace prefixes from Inceptus.DocumentEngine.* to Inceptus.DiagramEngine.*. Recompile consumers and migrate their complete dependency graph together: that rename is an intentional source and binary compatibility break. Update PackageReferences, C#/Razor imports and qualified type references for Contracts, Runtime, Bpmn, Organizational, Canvas2D and Bpmn.Blazor. Inceptus.Bpmn.Integration retained its Package ID, assembly name and namespace at 1.0.0; its public signatures expose DiagramEngine types. Do not mix the two families. DiagramEngine service registration remains in the Microsoft.Extensions.DependencyInjection namespace.

Native Inceptus.Document formatVersion 2, Inceptus.PublishedProcess formatVersion 1, BPMN functionality, browser preference keys and execution behavior are unchanged. Existing documents require no rebranding conversion. Microsoft production dependencies remain 10.0.14.

Since 1.0.0, RCL assets use _content/Inceptus.DiagramEngine.Canvas2D/ and _content/Inceptus.DiagramEngine.Bpmn.Blazor/. Update host-owned module/font URLs and rebuild published Blazor assets. Keep the existing JavaScript filenames.

Open BPMN Editor

Choose an integration level

Package Intended entry point
Inceptus.DiagramEngine.Bpmn.Blazor Reusable BPMN editor, read-only inspection and immutable document exchange.
Inceptus.Bpmn.Integration Native serialization, version compatibility, explicit document validation, BPMN 2.0.2 conversion and publishing package generation.
Inceptus.DiagramEngine.Contracts Advanced, notation-neutral immutable models and extension contracts; the snapshot graph is also part of ordinary facade input/output.
Inceptus.DiagramEngine.Runtime Advanced headless document, command, processing and History infrastructure.
Inceptus.DiagramEngine.Bpmn Advanced BPMN semantics, commands, validation and plugin contributions.
Inceptus.DiagramEngine.Organizational Advanced Organizational profile composition, independent of the browser renderer.
Inceptus.DiagramEngine.Canvas2D Advanced browser/session integration, generic Canvas2D rendering and standalone Publish construction.

Use the seven packages as an aligned version family. The modeler and Integration are separate entry points: hosts performing document transfer, validation or publishing reference both. Each brings its lower packages transitively. Integration depends on Contracts, Runtime, Bpmn, Organizational and Canvas2D; it does not depend on the editor UI or Demo. Independent mixed family versions are unsupported and unverified. Canvas2D requires its matching Runtime version because it consumes Runtime's internal History contract. Other dependency ranges retain their existing minimum-version policy. A direct dependency override can still produce an incompatible graph and a NuGet warning; the constraint is not a runtime compatibility guarantee.

Inceptus.DiagramEngine.Bpmn depends on both Contracts and Organizational. It uses Organizational's Pool membership, Participant assignment and region geometry for BPMN flow rules and editing. These dependencies resolve transitively; hosts using only editing still need only the Bpmn.Blazor reference.

Embed the modeler

The supported hosting model is a standalone Blazor WebAssembly application on .NET 10. Use the aligned 1.2.0 family when it is available from your package source:

<PackageReference Include="Inceptus.DiagramEngine.Bpmn.Blazor" Version="1.2.0" />
<PackageReference Include="Inceptus.Bpmn.Integration" Version="1.2.0" />

Register the modeler in the application's Program.cs. The extension namespace is Microsoft.Extensions.DependencyInjection:

using Microsoft.Extensions.DependencyInjection;

builder.Services.AddInceptusBpmnModeler();

Render the public component in a container with usable dimensions:

@using Inceptus.DiagramEngine.Bpmn.Blazor
@using Inceptus.DiagramEngine.Bpmn.Blazor.Components
@using Inceptus.DiagramEngine.Contracts.Documents

<div style="height: 75vh; min-height: 24rem;">
    <InceptusBpmnModeler @ref="_modeler"
                        InitialDocument="InitialSnapshot"
                        Ready="OnReady"
                        DocumentChanged="OnDocumentChanged"
                        OperationFailed="OnOperationFailed"
                        aria-label="Process modeler" />
</div>
<p>@_lastSnapshot?.DocumentId @_operationStatus</p>

@code {
    [Parameter] public DocumentSnapshot? InitialSnapshot { get; set; }
    private InceptusBpmnModeler? _modeler;
    private DocumentSnapshot? _lastSnapshot;
    private string? _operationStatus;

    private void OnReady(BpmnModelerReadyEventArgs args)
        => _lastSnapshot = args.Snapshot;

    private void OnDocumentChanged(BpmnModelerDocumentChangedEventArgs args)
        => _lastSnapshot = args.Snapshot;

    private void OnOperationFailed(BpmnModelerOperationFailedEventArgs args)
        => _operationStatus = $"{args.Operation}: {args.Status}";
}

Keep the host's generated scoped-CSS bundle linked in wwwroot/index.html, using the application's assembly name:

<link href="YourApplication.styles.css" rel="stylesheet" />

Razor static-web-asset integration supplies the package's JavaScript, scoped CSS and font. Do not copy modeler assets or reference engine source projects in a package consumer. Keep ordinary Blazor framework bootstrapping and the host's application base configuration. Root and non-root deployment use the same package assets; there are no modeler-specific asset URL options.

Class, Style and AdditionalAttributes (IReadOnlyDictionary<string, object>?, captured unmatched attributes) apply to the component wrapper. Ensure ancestor layout allows it to receive width and height.

Source Demo

The source Demo is a public reference application for integrating the modeler. Open Inceptus.DiagramEngine.sln and select Inceptus.DiagramEngine.Blazor, or run dotnet run --project src/Inceptus.DiagramEngine.Blazor -c Release from the source checkout. The project uses references to the current engine source; package consumers use the public component and PackageReferences described above. The same application has three modes with shared navigation and a responsive layout:

  • Editable (/): BPMN modelling, native Inceptus import/export, existing BPMN interchange, validation, graphical export and publication.
  • ReadOnly (/read-only/): native document viewing, automatic native selection information, navigation and SVG/PNG graphical export. No document import or native document export is offered.
  • Simulation (/simulation/): illustrative application-owned contextual actions, composite annotations and operational information over the same ReadOnly modeler. There is no simulation runtime or persistent profile configuration.

The mode links form one grouped selector in the top toolbar. In Simulation, Application action example and Annotation example share that toolbar; expand them to use the examples. Expanded controls reserve space above the diagram and scroll on narrow screens, leaving the native information panel dedicated to the selected target.

All routes support direct navigation and refresh when the host serves the Blazor application entry point for client-side routes. Switching modes creates an independent modeler; it does not transfer a document or change an instance's access mode.

Program.cs selects BpmnPoolDemoStartupDocumentProvider: Company A has Sales and Warehouse Lanes, alongside independent Supplier and Supplier B Pools. The alternative embedded branching order-process sample is available through BpmnDemoStartupDocumentProvider. It includes named event-gateway branches, an expandable subprocess and a boundary timer. Its two closely spaced branch labels have explicit placements; Reset label position restores automatic near-source placement.

The Editable Demo demonstrates activity selection, drag-preview, viewport culling, pan/zoom and renderer-cache paths without opt-in settings. Select activity bodies and captions, move activities, use Undo/Redo, and pan or zoom the diagram. Selection and viewport changes remain transient; accepted edits use Commands and History. The application source is available as an example; the Demo itself is not a NuGet package. Its host operations are described below.

Read-only inspection example

Open /read-only/ in the running Demo to use ReadOnlyBpmnDemoHost. The default / remains editable. Existing ?example=read-only links redirect to the read-only route. Its application toolbar offers Settings, Export SVG Image and Export PNG Image; the diagram retains selection, inspection, navigation, pan/zoom and maximise/restore. Settings are editor preferences, separate from the native document.

The default sample shows Pools and Lanes. Open /read-only/?sample=order for the Order Process sample with nested Process/SubProcess navigation, or /read-only/?sample=message for a named Message Flow between the Pool sample's Send and Receive Tasks. /read-only/?sample=vertical shows a straight vertical Sequence Flow between Prepare and Pack; /read-only/?sample=diagonal shows a prepared native diagram with a manual diagonal Message Flow. These opt-in samples retain ReadOnly restrictions. Selecting a body, label, connector or header automatically displays its native identity, type and properties in the dedicated information panel. Relationships include their native source and target identities. Smart activation is not required. Inspect details in the context menu reveals that request's actual target, following the native context-menu selection rules. Shift+F10 or the ContextMenu key opens the menu from the focused canvas selection. Arrow keys, Home/End and Enter/Space operate the menu; disabled items explain their state; Escape dismisses it and restores canvas focus. The native information panel uses immutable accepted-document values and stays separate from writable Properties or application operational data.

The read-only page attaches an immutable native snapshot and uses the existing presentation and guarded navigation APIs. Inspection does not edit the document or enter native History. The built-in Order Process, Message Flow and vertical Sequence Flow samples are prepared explicitly with the existing host preparation services before attachment; this preparation is separate from the read-only session and is not an import recovery path. The diagonal sample retains its embedded saved routing and is strictly verified without recovery. Changing samples or pages disposes the previous modeler and its pending application actions.

Simulation integration example

Open /simulation/ to use the same native ReadOnly viewing host with application examples. The same sample=order, message, vertical and diagonal choices are available on this route. Application action example demonstrates independently enabled Smart toolbar actions and popup actions with guarded exact-target dispatch. The floating toolbar uses icons; popup items retain text and disabled explanations. The application-owned inspector keeps its captured target and does not edit the native diagram. Annotation example demonstrates text, SVG plus text and SVG-only messages, including several independent messages on each eligible element, with update, variant switching, removal and clear operations. Values are illustrative application data, not live simulation results.

The Demo is a reference application, not a comprehensive test tool. Existing source-only controls are available through Source Demo maintenance → Enable existing maintenance controls, disabled by default. Editable exposes its generic application examples there; Simulation exposes their diagnostic inputs there; ReadOnly offers only native replacement/lifecycle maintenance. Ordinary usage does not require maintenance controls. There is no additional modeler access mode or alternative import workflow.

Editing tools

The main Toolbox provides family-level Events, Activities and Gateways entries, plus a FLOW group with Sequence Flow and Message Flow. EVENTS, ACTIVITIES, GATEWAYS and FLOW start collapsed; expand a group to choose a tool. Properties supports switching compatible concrete Task, intermediate Event, Boundary Event and Gateway types while preserving identity and compatible state. Invalid switches are rejected without changing the document.

Properties uses a nine-row Description field with multiline editing and the existing Apply/Cancel and History behavior. Smart Edit offers Open SubProcess for an eligible selected SubProcess, using the existing scope navigation, breadcrumb return and navigation History. These controls belong to the packaged editor; hosts do not need a separate Properties or Smart Edit implementation.

Start and End Events support optional Names in Properties and display nonblank names as external labels below the event. Newly created Events start unnamed; clearing a Name removes it. Event Data exposes Name while existing type selectors and event parameters remain available. Apply and Undo/Redo preserve the exact previous optional value, identities, attachments and retained geometry. Names and their resolved text colours are included in graphical exports and published presentations without changing process execution.

The contextual Properties action now follows the selected element's actual editable schema, including supported missing values. With Smart Edit enabled, a completed click on a Sequence Flow or Message Flow opens a compact connector toolbox containing Properties and Delete near the click. Dragging, reconnecting, bend editing and modifier selection do not open it. Connector edits and deletion use the existing Commands and History, including exact Undo/Redo restoration. Version 0.1.16 corrects Delete for horizontal and vertical connector bounds without changing node visibility or general rectangle semantics. Message Flow Undo restores its original scope-owned routing record, including Straight or Manual routing, path geometry and ordering.

Message Flow connects different effective Participants in the supported Pool diagram. A standalone Pool supplies its own communication identity; Pools assigned to the same Participant are presented as adjoining Lanes. Supported endpoints include eligible Activities, directional Message Events, standalone Pools and shared Participant labels. Lane-mode Pools are not direct endpoints. Unassigned elements cannot be Message Flow endpoints.

Auto Arrange reorganizes the active Process scope, including its visible Pool/Lane diagram, through one undoable edit. It preserves semantic identities, membership and routing modes; hidden child scopes remain unchanged. Sequence Flow drives placement. Crossing reduction and connector-point improvement use bounded heuristics rather than a global optimal-layout guarantee.

Smart Edit starts ON. Selecting one eligible flow node shows contextual Properties / Auto Points / Delete actions and compatible Events / Activities / Gateways creation choices. Smart Create adds the chosen element and its Sequence Flow atomically in one History operation, inherits the source's supported Pool/Lane context, and selects the new element for continued creation. Auto Points conservatively improves eligible incident connection points. Turning Smart Edit OFF hides both contextual toolboxes while ordinary editing remains available; turning it ON restores tools eligible for the current selection. Smart Edit and Toolbox expansion are transient editor UI state, not saved document preferences.

Document colour schemes

Document Properties offers White and Mixed colour schemes. White is the fallback for documents without appearance metadata and retains the established header presentation. Mixed supplies coordinated colours for Start Events, Tasks, Gateways, End Events and Pool, Lane and Participant headers. Each scheme retains its own background, border and text overrides; header colours apply by family, not to individual Pool/Lane/Participant instances.

Edit colours opens the dedicated Colour Scheme editor with seven family previews, colour pickers, #RRGGBB fields and Restore preset. The White Participant header can retain its default unfilled background. Use colours accepts edits into the parent draft; only Document Properties Apply commits them. Cancel discards the relevant draft, and stale drafts cannot overwrite newer state. The form follows the Document Properties layout with scrollable content and fixed actions, and uses the packaged English, Polish, French, German and Spanish UI.

Appearance is stored in the document's existing extension metadata through the normal validated Command and History path. Undo/Redo restores exact values; native JSON preserves overrides and unknown metadata. Invalid colour values use safe presentation fallbacks; unsupported appearance versions are read-only. Changes recompose the Scene without rearranging nodes or rerouting connectors. SVG, PNG and PublishedProcess capture resolved paint; execution semantics and native/published format versions remain unchanged.

These controls and behaviours are supplied by the DiagramEngine modeler. Existing package hosts receive them by updating the aligned package family and retaining normal Razor static assets and localization setup. No host colour form, connector toolbox or event-name implementation is required. The source Demo's placement-preview toolbar cache adjustment belongs to its own host orchestration.

Graphical export and drawing area

The source Demo's Export menu also offers SVG Image and PNG Image. Both export the complete current diagram level, including content outside the visible viewport, independently of zoom and pan. Export does not validate BPMN, modify the document, enter History or acknowledge native save state.

External hosts capture with CapturePresentationAsync() and use the public Canvas2DGraphicalExporter with GraphicalExportOptions and their editor's font and image configuration. GraphicalExportPreparer shares preparation across formats; SvgGraphicalExporter also supports managed-only SVG generation. The host owns menus, downloads and operation feedback.

The editor's internal Maximize drawing area / Restore drawing area toggle uses BpmnModelerDisplayMode.Normal / Maximized. Bind DisplayMode and DisplayModeChanged so the host can hide its own operations toolbar and expand its container to the available viewport. Keep the same editor mounted. The packaged component automatically selects Compact toolbox mode on entry and restores the previous mode on exit, preserving document, selection, zoom, pan and History.

Two touchscreen contacts pan by their midpoint at fixed zoom; wheel/touchpad input uses ordered, bounded delivery and compatible-event coalescing. Gesture takeover safely cancels conflicting editing previews. One-finger touch placement commits on release, while mouse placement retains its existing behavior. Panning does not modify the document or History. Hosts receive this through the packaged CSS/JavaScript and should not add a second gesture handler.

Physical mobile-device, touchscreen and laptop-touchpad compatibility has not been established. Browser simulation and automated coverage do not establish physical-device compatibility.

UI localization

The modeler UI supports English (en / en-GB), Polish (pl / pl-PL), French (fr / fr-FR), German (de / de-DE) and Spanish (es / es-ES). English is the neutral resource and final fallback. Standard .NET resource resolution also supports parent fallback: fr-CA, de-AT and es-MX use French, German and Spanish; en-US and unsupported cultures such as it-IT use English.

CultureInfo.CurrentUICulture is the sole culture authority. DiagramEngine service registration includes standard localization registration; consumers do not need internal resource types. The RCL carries its resources and satellite assemblies. There is no public Language or Culture parameter and no built-in language selector.

For runtime switching, change the host UI culture in its normal Blazor rendering context and re-render. A host can cascade that culture to ensure even a parameterless modeler receives the render notification:

@using System.Globalization

<CascadingValue Value="CultureInfo.CurrentUICulture">
    <InceptusBpmnModeler />
</CascadingValue>

The cascade is a render notification, not an override: set the ambient CurrentUICulture as well as updating the host render. The host remains responsible for its normal culture lifetime and WebAssembly globalization/ICU configuration. Changing culture does not replace the Document or editing session, write History, reset selection/viewport, or invoke DocumentChanged. Open dialogs and feedback resolve presentation labels again on rendering.

Document names, property values, diagnostic identities and canonical diagnostic messages remain unchanged. Native import/export and PublishedProcess use their existing English-based, culture-invariant schemas; there is no public data-format change. Only UI wrappers around canonical diagnostics are localized. The standalone exported PublishedProcess viewer remains outside modeler localization scope. Host-owned labels and documentation remain the host's responsibility.

Document ownership and notifications

The component owns its live Document, editing session, History and browser resources. Hosts exchange immutable DocumentSnapshot graphs, immutable diagnostic/result objects and copied file bytes. Do not retain a mutable engine runtime through ordinary integration.

InitialDocument is consumed once, at initialization. A supplied snapshot takes precedence over the advanced startup provider. Null uses the provider if one is registered, otherwise canonical empty startup. Later parameter changes do not replace the document: call SetDocumentAsync explicitly. Two components reconstruct independent live state even from the same initial snapshot.

  • Ready: EventCallback<BpmnModelerReadyEventArgs>, once after successful initial attachment; Snapshot is the initial persistent state. Attachment alone does not emit DocumentChanged.
  • DocumentChanged: EventCallback<BpmnModelerDocumentChangedEventArgs>; exposes Snapshot and Kind (PersistentMutation or DocumentReplacement). Accepted persistent edits, Undo/Redo and replacements notify; selection, pan/zoom, scope navigation, validation alone and transient visibility do not.
  • OperationFailed: EventCallback<BpmnModelerOperationFailedEventArgs>; exposes Operation, Status and ImmutableArray<Diagnostic> Diagnostics. These are bounded operation diagnostics, separate from model-validation Issues. Expected cancellation does not emit a failure callback. Context-edit rejections use the editor's interaction diagnostics, not an additional facade callback kind.

Callback invocation is ordered. Arbitrary asynchronous consumer callbacks may complete in a different order and may await subsequent modeler operations. Callback exceptions do not roll back committed changes. Track DocumentId together with revision: replacing a document can legitimately lower the revision number. Disposal and retired sessions suppress stale notifications.

Transient application decorations

The 1.2.0 candidate includes a passive decoration API on the DiagramEngine modeler in both editable and read-only modes. This API is absent from 1.1.2 packages. The source Demo exposes Annotation example in Simulation (/simulation/); Editable and ReadOnly retain it through the opt-in maintenance area. Change the note and choose Update annotations, Show mixed annotations, Clear annotations, or Demonstrate failure. The mixed example places text-only, SVG-with-text and SVG-only messages on the same element. Select a message to update it, switch its variant or remove it independently. The panel shows the submitted revision, acceptance, result status and frame acknowledgment. Its reusable control and stateless provider are in src/Inceptus.DiagramEngine.Blazor/Demo/DemoAnnotations.razor and DemoAnnotationProvider.cs.

The opt-in Lifecycle verification panel also supports normal in-app unmount/remount. After unmounting, Read lifecycle observations displays copied internal cleanup receipts and the exact decoration task's state at child disposal entry. This source-Demo aid adds no public diagnostics API. It does not force work to remain pending; an operation that completed before entry does not establish pending-at-disposal coverage. Normal modeler behavior is unchanged when verification controls are unused.

Capture an opaque attachment after the component is ready, then submit increasing positive application revisions. The handle belongs to one component and accepted source; native document edits, selection and view changes do not retire it. Successful source replacement does, even if native IDs and revision are identical. Failed or cancelled replacement retains the previous accepted source and decoration input. Disposal retires the handle and callbacks.

var attachment = modeler.CaptureDecorationAttachment();
if (attachment is null) return; // The component has no ready attachment.

var input = new Canvas2DDecorationInput(NoteProvider.Id, new NoteProvider(),
[
    new("owner", PropertyValue.FromText(ownerId.Value)),
    new("text", PropertyValue.FromText("Review note"))
]);
var update = await modeler.ReplaceDecorationsAsync(attachment, 1, input, cancellationToken);
// Check update.Accepted, update.Status, update.Presentation and update.Diagnostics.
var clear = await modeler.ClearDecorationsAsync(attachment, 2, cancellationToken);

Canvas2DDecorationInput copies values into an immutable PropertyMap. Providers implement ICanvas2DDecorationProvider from Inceptus.DiagramEngine.Contracts.Canvas2D; they must be stateless and deterministic, reading only the supplied frozen values and native context. Do not capture a changing dictionary, closure, live Document, session or renderer. Submit a new frozen input to change application data. The callback is synchronous and must return promptly; cancellation cannot interrupt arbitrary application code already executing.

For example, an application can annotate one explicitly identified body:

using Inceptus.DiagramEngine.Contracts.Canvas2D;
using Inceptus.DiagramEngine.Contracts.Geometry;
using Inceptus.DiagramEngine.Contracts.Primitives;
using Inceptus.DiagramEngine.Contracts.Properties;

public sealed class NoteProvider : ICanvas2DDecorationProvider
{
    public static readonly Canvas2DSceneContributorId Id = new("my-app:notes");

    public Canvas2DDecorationContent Compose(Canvas2DDecorationContext context, PropertyMap input)
    {
        var parts = context.FindParts(new SemanticElementId(input["owner"].TextValue),
            Canvas2DDecorationOwnerKind.Element, Canvas2DDecorationPartKind.NodeBody);
        if (parts.Length != 1) return Canvas2DDecorationContent.Empty;
        var body = parts[0]; // Exactly one match; missing/ambiguous owners are omitted.
        var bounds = new RectD(body.Item.Bounds.X, body.Item.Bounds.Bottom + 5, 180, 22);
        const string key = "review-note";
        return new([
            new Canvas2DSceneItem(Canvas2DSceneObjectIdentity.ForExtension(Id, key),
                Canvas2DSceneLayer.Decoration, 0,
                Canvas2DSceneGeometry.Text(bounds, input["text"].TextValue), body.CreateOrigin(key),
                clip: bounds,
                style: new Canvas2DSceneStyle(fill: "#155e75", fontFamily: context.DefaultFontFamily),
                hitTestPolicy: Canvas2DHitTestPolicy.None)
        ]);
    }
}

Context contains immutable native BaseItems after final spatial/process placement, attachment/document/revision, scope/view context, base-scene generation and input revision. It never contains previous decorations. Parts and FindParts preserve semantic owner, element/relationship kind and exact body, label, connector or semantic-region part. Pool, Lane and Participant ownership remain distinct. Resolve by identity and exact part; omit missing, hidden or ambiguous matches, or return a bounded diagnostic. Item Bounds are final document coordinates; native geometry retains its item transform conventions. Do not apply native spatial mapping a second time. Borrowed native objects must not be retained, mutated or disposed.

Output is an immutable Canvas2DDecorationContent of existing generic scene primitives, bounded to 10,000 items and 32 diagnostics. Every item must use the Decoration layer, HitTestPolicy.None, an extension ID from the submitted provider ID and stable source key, and part.CreateOrigin(key) for its exact visible native source part. Duplicate/colliding IDs, invalid origins, non-finite geometry, unconfigured fonts/images, persistent appearance, interaction metadata or spatial mapping contributions fail composition. Text uses the host's configured DefaultFontFamily; this initial API provides fixed-box text primitives, not a text-measurement callback. Providers choose explicit bounds and clips for their text; bounds alone do not clip drawing. Decorations order by Z-index and then ordinal ID, above native content and below native interaction feedback. They cannot become selection, editing, context-menu or command targets.

The session retains the native base separately and serializes installation with rendering. An input-only update does not run projection, layout, routing or saved-geometry preparation, issue a command, advance the native revision or History, or change selection/scope/viewport. Native scene changes recompose the accepted input. Pan, zoom, resize, DPR and maximize use the native renderer and surface lifecycle. Decoration content and native base generation both participate in render reuse; a previous decoration frame is never accepted as current.

Canvas2DDecorationUpdateResult separates Accepted from frame completion:

Status Meaning
Presented The renderer acknowledged the submitted revision against the reported native base.
Rejected A stale/wrong attachment, non-increasing revision or invalid SVG resource catalog was rejected before acceptance.
Unavailable No usable current attachment/base, an overlapping submission, or native currency/lifecycle changed during presentation. Check Accepted.
Cancelled Cancellation occurred before acceptance; the previous accepted input remains.
Superseded An accepted input lost currency to a later input.
Failed Accepted input failed composition/output validation, SVG readiness or graphics; inspect diagnostics and frame status.

Presentation reports attachment, document/revision, scope/view, base generation, input revision, FramePresented and DecorationsIncluded. Acceptance consumes the revision even if composition or graphics subsequently fails. Reusing a revision is not a retry: increment it. Only one update is admitted at a time; overlapping submissions return Unavailable without queuing input. Cancellation after acceptance does not roll back committed input and does not suppress truthful completion. Native changes during composition may return an accepted but unavailable result; applications may retry with a newer revision. After native view/geometry changes, read current DecorationInputRevision, DecorationPresentation and DecorationDiagnostics from CaptureEditorContext()?.Presentation; a completed submission result describes its own attempted frame and does not become a live status object.

Newly accepted input replaces older values. A provider exception or invalid output can present a native-only fallback: Failed with FramePresented == true and DecorationsIncluded == false. Graphics failure does not claim the screen was updated or cleared. Clearing is a versioned empty input, subject to the same acknowledgment rules. Decoration failures are separate from native technical-import and strict-routing failures.

Decorations may extend outside an owner's body, with an optional document-space clip and the canvas viewport. They do not enlarge native containers, extents, saved scope geometry, fit/content or export bounds. Adding, changing and clearing them never fits, pans or zooms. Graphical export and publication use the retained native presentation, so both projected and semantic-only decorations are excluded even far beyond native extents. This separate transient path does not register saved-geometry contributors or change persistence formats; existing strict native fixtures remain compatible.

SVG and composite messages

The source API accepts immutable SVG resources alongside the same frozen decoration input. The existing three-argument constructor remains supported; the additional four-argument constructor takes a Canvas2DDecorationResourceSet. Acquire SVG text in application code before submitting it; providers do not fetch resources or perform asynchronous work.

var resources = new Canvas2DDecorationResourceSet([
    new Canvas2DDecorationSvgResource("my-app:status", svgText)
]);
var input = new Canvas2DDecorationInput(MyProvider.Id, new MyProvider(), values, resources);
var result = await modeler.ReplaceDecorationsAsync(attachment, nextRevision, input);

One logical message emits one Text primitive, one Image primitive, or both. An image uses Canvas2DSceneGeometry.Image(bounds, "my-app:status"). Give each message a stable application ID and each child a distinct extension key, such as an unambiguous encoding of owner, native part, message ID and child role. Both children use the same exact native part origin and deterministic layout. Multiple messages can share an element; the engine does not impose one message per owner or create an implicit group. Submit the complete desired collection on each increasing revision. Reserve enough primitive slots for a whole message; never truncate an SVG/text pair to fit the existing 10,000-item budget.

Resource references are namespaced, case-sensitive strings, at most 256 characters, with no whitespace. Invalid constructor arguments, duplicate references and more than 64 resources throw before submission. Admission validation rejects a catalog that replaces native image resources. Changing SVG bytes under the same reference invalidates cached artwork. Clear, successful source replacement and disposal retire the corresponding resource leases.

The supported profile is self-contained static SVG: an svg root in the default SVG namespace, unprefixed elements, explicit positive width/height (numbers or px), a required four-number viewBox with positive extents, and basic g, path, rect, circle, ellipse, line, polyline and polygon shapes. Solid named/hex paints, basic transforms, opacity and stroke attributes are supported. Scripts, event handlers, CSS, external/local references, embedded images, fonts/text, animation, filters and foreignObject are rejected. General-purpose SVG files may need application-side conversion to this restricted profile.

Limits are 64 resources, 256 KiB UTF-8 per resource, 2 MiB total, 4,096 XML elements and path segments per resource, 32,768 numeric values per resource, nesting depth at most 32 beneath the root, 32 attributes per element and 32 transforms per transform attribute. Coordinates must be finite with magnitude at most 1,000,000. Intrinsic dimensions are at most 1,024 × 1,024 and 8,000,000 decoded pixels across the catalog. Catalog validation happens before acceptance, preserving the previous input on rejection. See the validator and its canonical tests for exact attribute and path syntax.

All required SVG images must be ready before the combined frame is drawn; unused catalog entries are validated but not decoded. One ten-second preparation deadline covers the frame. Decode failure or timeout retains the accepted revision but omits all decorations; a successful native-only draw reports Failed, FramePresented == true, DecorationsIncluded == false. Failed native fallback never claims a presented frame. The failed resource input is not retried on each pan or recompose: submit a newer revision for an explicit retry. Late decode completion cannot install retired artwork. Browser decode itself is not forcibly cancellable; owned waits and resource leases are retired independently.

The Demo uses 20-unit images, 180-unit clipped text and deterministic 28-unit rows. These are example layout choices, not automatic fitting or collision avoidance. Annotation geometry scales with native zoom; DPR is applied once by the surface. Interactive controls, annotation export and application form semantics remain outside this passive mechanism.

Read-only presentation and application actions

Version 1.1.0 adds the DiagramEngine modeler's AccessMode parameter of type EditingSessionAccessMode (Inceptus.DiagramEngine.Canvas2D.EditingSession). Its default is Editable. Set ReadOnly when constructing the component; changing it during that component's lifetime throws. Remount to choose a different access mode. Normal/Maximized DisplayMode is a separate, changeable presentation setting.

Read-only sessions preserve the complete attached native document, including revision, semantic/visual identities, geometry, routing, anchors, metadata and native History. Native editing commands, Undo/Redo and publication metadata updates are rejected. Selection, hover, pan/zoom, transient visibility and supported Process/SubProcess navigation remain available; read-only navigation adds no native History. Editable navigation retains its established chronological History behavior.

Hosts may explicitly replace a read-only attachment using SetDocumentAsync; the new session remains read-only. Failed/cancelled replacement preserves the previous usable attachment. ReprepareIncompatibleRouting is rejected for a read-only attachment: prepare incompatible content separately before supplying the accepted snapshot. This is a component-owned enforcement boundary, not a security sandbox for arbitrary application code that separately owns a mutable runtime.

The same component implements IBpmnDiagramPresentation alongside the unchanged IBpmnDocumentEditor contract:

BpmnPresentationSnapshot CapturePresentation();
ValueTask<BpmnPresentationOperationResult> SelectVisualAsync(
    BpmnPresentationContextStamp context, VisualStateId visualStateId,
    CancellationToken cancellationToken = default);
ValueTask<BpmnPresentationOperationResult> NavigateToScopeAsync(
    BpmnPresentationContextStamp context, DocumentScopeId scopeId,
    CancellationToken cancellationToken = default);

Capture a fresh presentation immediately before a guarded operation and use its Stamp. Do not manufacture or cache stamps across operations. A stamp includes component, attachment, document/revision, scope/context and selection currency. Replacing with identical IDs/revision still invalidates it, as do selection/context changes and disposal. Inspect the returned Succeeded, Status, Presentation and Diagnostics; a rejected stale request is not retried against a different target. The legacy unstamped visual selection overload remains compatible for editors and is rejected in read-only mode.

CapturePresentation() returns immutable ordered Selection, optional PrimaryPart, ActiveScopeId, ScopePath, AvailableScopes and diagnostics. IsAvailable == false means there is no actionable stamp or selection; this differs from an available empty selection. SelectionChanged is an EventCallback<BpmnSelectionChangedEventArgs> carrying that snapshot. It reports logical selection/primary-part changes and clearing on lifecycle changes; hover and viewport changes do not masquerade as selection events. Readback can be temporarily unavailable while a frame is being presented; use the selection notification as the logical selection authority, rather than interpreting every unavailable readback as a selection clearing. The existing ViewChanged semantics are unchanged.

Each BpmnSemanticSelectionTarget preserves SemanticId, element-versus-relationship Kind, optional VisualStateId and its presentation Parts. A flow is a relationship; a Pool/Lane header and its Participant remain different semantic elements. Labels are parts of their owners, not new semantic IDs. Semantic-only targets need no fabricated visual identity. Background, decorations and ambiguous owners do not yield invented targets.

Configure application actions per component:

@using Inceptus.DiagramEngine.Bpmn.Blazor
@using Inceptus.DiagramEngine.Bpmn.Blazor.Components
@using Inceptus.DiagramEngine.Canvas2D.EditingSession
@using Inceptus.DiagramEngine.Contracts.Documents

<InceptusBpmnModeler InitialDocument="Snapshot" AccessMode="EditingSessionAccessMode.ReadOnly"
    ApplicationActionProvider="DiscoverActions" ApplicationActionInvoked="Inspect" />
<p>@details</p>

@code {
    [Parameter, EditorRequired] public DocumentSnapshot Snapshot { get; set; } = null!;
    private string details = "Select an element to inspect.";

    private ValueTask<IEnumerable<BpmnApplicationAction>> DiscoverActions(
        BpmnApplicationActionContext context, CancellationToken cancellationToken)
    {
        cancellationToken.ThrowIfCancellationRequested();
        return ValueTask.FromResult<IEnumerable<BpmnApplicationAction>>(
            [new("app:inspect", "Inspect details"),
             new("app:external", "Open external record", false, "No application connection.")]);
    }

    private Task Inspect(BpmnApplicationActionInvocationEventArgs args)
    {
        if (!args.CancellationToken.IsCancellationRequested && args.ActionId == "app:inspect")
            details = $"{args.Context.Target.Kind}: {args.Context.Target.SemanticId.Value}";
        return Task.CompletedTask;
    }
}

The provider may await application services with the supplied cancellation token. Its descriptor sequence is copied; IDs must be nonblank, unique, trimmed and contain no control characters, and labels must be nonblank. Invalid results reject the entire application group. Descriptors have get-only Id, Label, IsEnabled and optional DisabledExplanation. No native editing Commands or live engine handles are exposed.

Discovery and invocation share an immutable BpmnApplicationActionContext: Presentation, Stamp, Target, optional exact Part, and a request/menu RequestVersion. Availability and target currency are checked again before the callback. Replacement, navigation, selection changes, target concealment/removal, menu dismissal/supersession and disposal retire pending work. Equivalent hover recomposition does not invalidate an otherwise current menu. Provider/callback exceptions produce bounded OperationFailed feedback with BpmnModelerOperation.ApplicationAction.

Callbacks execute outside native locks, in invocation order, and may await later modeler operations. Their completions may arrive out of order. Once an external callback starts, cancellation is cooperative and DiagramEngine cannot reverse application-side effects. Validate your application's own run/version before applying asynchronous business results. With no provider the editable context menu is unchanged; opting in adds a separate application group alongside native editor actions. Read-only menus contain application actions and permitted inspection/navigation actions.

Smart contextual toolbar and popup

The 1.2.0 candidate adds an engine-rendered Smart contextual toolbar alongside the popup. These additions are absent from 1.1.2 packages. Both presentations work in Editable and ReadOnly; application Smart activation is independent of native Smart Edit. The application owns labels, icons, applicability, handling and any editor/dialog it opens. The modeler supplies the control shell, positioning and guarded immutable target context.

Set ApplicationContextualActionsEnabled="true" to enable the toolbar (default false). Disabling it leaves popup actions available. The toolbar needs one unambiguous selected owner; a popup uses its explicit request target, which may differ from the current selection. BpmnApplicationActionContext.Target therefore need not belong to Presentation.Selection. Part remains the actual hit when known; keyboard activation does not invent a pointer hit or substitute the internal toolbar anchor. Labels and bodies can have the same semantic owner, while relationships remain distinct from elements.

Advance ApplicationActionsRevision when application policy or definitions change, even when the provider delegate and native selection are unchanged. It defaults to zero and must be nonnegative and monotonic for that component lifetime, including source replacement. The same revision may be retained through ordinary renders. Changes retire stale discovery and invocation in both presentations without native edits, layout/routing or remounting. Invalid revision/conflicting registrations disable application controls with bounded feedback; correcting the configuration restores eligible discovery. Native actions retain their rules.

Use either the existing ApplicationActionInvoked callback or ApplicationActionHandler, never both. The optional typed handler returns ValueTask<BpmnApplicationActionResult>:

private ValueTask<BpmnApplicationActionResult> InspectTyped(
    BpmnApplicationActionInvocationEventArgs invocation)
{
    // Open application-owned UI for invocation.Context.Target and your own current policy.
    // Keep native attachment/owner context and revalidate your application data before saving.
    return ValueTask.FromResult(new BpmnApplicationActionResult(
        BpmnModelerOperationStatus.Succeeded));
}

Typed results admit Succeeded, Unavailable, Cancelled and Failed. Success completes the handling attempt, such as opening an editor; it does not certify a later configuration save. Unavailable/failed outcomes use existing OperationFailed feedback; declared cancellation does not. Null results and exceptions produce bounded failures. A typed cancellation exception is cancellation only when its invocation token was requested; legacy callback behavior remains unchanged. Attempt tokens end with completion/retirement, not with an application's modal lifetime. Typed diagnostics are bounded immutable values; invalid result construction is a handling failure.

An optional BpmnApplicationActionIcon contains one static monochrome path and a RectD view box. Pass it through the additive five-argument action constructor; the original constructor is unchanged. The icon accepts explicit uppercase M, L, H, V, C, Q, Z commands with finite operands, at most 4,096 characters/256 commands and magnitude at most 1,000,000. View-box extents must be positive and finite. It is decorative encoded geometry, not SVG markup, a URL, template, image resource or an interactive control. The floating toolbar shows icons only, with full action names as accessible labels and tooltips. Actions without an icon use a generic decorative fallback. Popup and overflow menus keep visible action labels and disabled explanations. This icon contract is independent of passive composite annotation resources.

Toolbar buttons keep readable CSS sizing through native pan/zoom and surface changes. Nodes anchor to their body, relationships to their final route midpoint and organisational representations to their authoritative header/body. Bounded placement and an accessible More actions menu retain all supplied actions in order. Hidden, offscreen or temporarily incoherent targets suspend the toolbar. Interactive controls remain separate from passive annotations and never alter native content, revision, History, routes, export or publication.

Escape intentionally dismisses the toolbar for the current logical selection. Pan, resize and policy refresh do not reopen it. An application-owned Show contextual actions control can request it:

var presentation = modeler.CapturePresentation();
if (presentation.Stamp is { } stamp)
    await modeler.RequestApplicationContextualActionsAsync(stamp, applicationRevision);

This operation validates both currencies and acknowledges discovery admission, not provider results or a rendered frame. It changes neither selection nor focus. A popup temporarily suspends an eligible toolbar; closure revalidates it and never undoes intentional dismissal. Popup items begin directly with the first action, without an application heading or leading internal separator. Separators occur only between actual nonempty groups; native eligibility, order and disabled explanations remain intact.

The application owns dialog focus trapping and a stable application-owned return target. Invoking an action does not force focus back to the canvas after the handler opens its UI. See the source Demo's Application action example in both routes: Smart activation, application-only availability/revision, additional actions for overflow, typed/legacy handling, explicit reactivation and an application inspector. Its opt-in Enable application verification controls adds empty/missing/conflicting registrations, invalid application revisions with recovery, immediate typed error outcomes, and capture/replay of an immutable contextual request. The application outcome and the modeler's failure notifications are shown separately. Legacy callbacks retain their normal inspector behavior. Inside the inspector, verification controls can replace the current source through strict public replacement or request normal parent unmount while keeping the captured inspection target visible. These examples do not observe asynchronous managed cleanup or force pending-operation timing. The opt-in Load application catalogue asynchronously uses a same-origin HTTP read of src/Inceptus.DiagramEngine.Blazor/wwwroot/demo/application-action-catalog.json for action policy and inspector text. Read application task observations samples a bounded, application-owned journal of request identities, actual provider/handler and HTTP task states, cancellation and completion. Pending loading is nonmodal; both routes also expose strict replacement in their existing opt-in verification controls. Local or cached loads may finish before another interaction: a loading message does not prove a pending race. These observations do not expose the private dispatch queue, acknowledge engine acceptance or establish application work remaining pending at managed disposal entry. The opt-in Application label preset selects ordinary/catalogue English, long English or sample German, Spanish, French and Polish labels and disabled explanations. It advances the application revision for both ordinary and catalogue discovery while preserving action identities and handlers. The floating toolbar remains icons-only; full labels appear in accessible names, tooltips and menus. Independently, Modeler UI culture selects existing native UI resources with a normal page reload (?uiCulture=en, de, es, fr or pl, retaining the route and other query inputs). Missing, unsupported or repeated culture values fall back to English. Numeric formatting stays invariant. The active culture is shown in the panel; reloading resets Demo inputs and does not persist an application label preset. These are source Demo inputs, not new modeler culture parameters. The source Demo includes all WebAssembly globalization data to support these startup choices; this increases its browser download and does not change packaged modeler configuration. The example code is in src/Inceptus.DiagramEngine.Blazor/Demo/DemoApplicationActions.razor and DemoApplicationActionExample.cs. The modeler exposes no external floating-overlay lifecycle, public continuous geometry feed or focus-return API. Passive annotation support is described separately above.

Editor document API and host operations

Public API migration from 0.1.9: native Import/Export and Publish facade methods were removed; application-level Import/Export/Validate/Publish controls and validation reporting now belong to the host. Add the Integration PackageReference above and move file selection, downloads and operation feedback to your host. Do not replace removed methods with editor internals or source/DLL references.

Previous integration Host responsibility
ImportNativeDocumentAsync Deserialize bytes, check native version with the migrator, call SetDocumentAsync with saved-routing verification.
ExportNativeDocumentAsync Capture with GetDocumentAsync, serialize, download, acknowledge the matching native save checkpoint only after successful storage.
Editor Validate / Issues Explicitly call BpmnDocumentValidator and present its report; no automatic validation during Import/Export.
PublishAsync Capture and validate the document, capture its matching immutable presentation, invoke PublishingPackageGenerator, download the ZIP.
BPMN XML exchange Use ImportAsync with the existing routing/geometry preparer and atomic installation; use code-defined Export and download document.xml. Report conversion losses separately from operation failures.

BpmnDocumentSerializer and BpmnDocumentMigrator are static services. Create BpmnDocumentValidator and PublishingPackageGenerator as host-owned services. Native JSON is the full-fidelity persistence format; BPMN XML is a potentially lossy interchange format and must not acknowledge a native save checkpoint. See the source Demo and host operation sequence below for composition, technical rejection handling and validation-state invalidation.

The canonical document remains DocumentSnapshot from Inceptus.DiagramEngine.Contracts.Documents. The reusable editor implements IBpmnDocumentEditor. Its document API is:

BpmnModelerDocumentResult GetDocument();
ValueTask<BpmnModelerDocumentResult> GetDocumentAsync(CancellationToken cancellationToken = default);
ValueTask<BpmnModelerDocumentResult> SetDocumentAsync(
    DocumentSnapshot? document, CancellationToken cancellationToken = default);

The asynchronous capture waits for accepted mutations. Neither capture method serializes, validates or creates files. SetDocumentAsync installs a prepared snapshot atomically in a fresh session with fresh History and editor state. It preserves supplied identities; failure or cancellation retains the previous usable editor. Editing commands and Undo/Redo continue through the existing session. CaptureDocumentSnapshot and LoadDocumentAsync remain compatibility aliases; NewDocumentAsync remains an editor lifecycle operation.

Inspect Succeeded, Status, Snapshot and Diagnostics on document results. Status is one of Succeeded, Rejected, Unavailable, Failed, Cancelled. The editor no longer offers ImportNativeDocumentAsync, ExportNativeDocumentAsync or PublishAsync, or renders Import/Export/Validate/Publish controls. Immutable file-result and save-checkpoint contracts remain available to hosts.

The source Demo's BpmnDemoHost and DemoDocumentOperations are the reference host implementation:

  • Import: host reads bytes, BpmnDocumentSerializer.Deserialize, BpmnDocumentMigrator.Migrate, then SetDocumentAsync with the existing atomic attachment/integrity checks.
  • Export: GetDocumentAsync, serializer, host download, then acknowledge the issued save checkpoint.
  • Validate: capture the document and immutable view context, run the integration validator, and display the report in the host.
  • Publish: capture the document, validate, capture immutable presentation data, generate the package, and download it in the host.

Import and Export do not invoke BpmnDocumentValidator or run model-quality rules. Technical format, compatibility, reconstruction and routing-integrity failures can still block transfer. A document with model-quality errors or warnings can be transferred; the user chooses when to Validate. The package builder retains its existing publication eligibility checks. Validation does not change the document. Rules remain in the notation packages, composed by the integration validator; the editor holds no document-validation report.

CaptureEditorContext and ViewChanged let a host track attachment, scope and edit availability without a live runtime handle. SelectVisualAsync provides guarded issue-target selection. CapturePresentationAsync supplies immutable active-view data; UpdatePublicationAsync edits publication metadata through the existing command/history path. Save checkpoint issuance and acknowledgement track externally completed storage without performing it.

Native JSON remains Inceptus.Document, formatVersion 2. The migrator accepts v2 unchanged and explicitly rejects unsupported versions; no legacy migrations exist. The optional BpmnModelerDocumentLoadOptions overload preserves saved-routing verification and opt-in incompatible-v2 recovery during attachment. This requires the editor's renderer metrics and routing configuration and is an internal attachment precondition, not schema migration. Recovered content remains unsaved.

Start/End Event captions now use OutsideBelow placement. Older v2 documents with saved InsideCentered caption geometry can fail strict attachment with INCEPTUS.ROUTING.SAVED_STATE.INCOMPATIBLE. To recover deliberately, call SetDocumentAsync with VerifySavedRouting = true and ReprepareIncompatibleRouting = true, then save the recovered native document and verify a subsequent strict load with the same rendering configuration. Recovery regenerates incompatible routing; no automatic recovery or silent schema migration is performed.

BpmnStandardConverter converts the supported interchange subset of BPMN 2.0.2. Native schema version and BPMN standard version remain separate concepts. Conversion is deliberately lossy; it is not executable-process certification.

var imported = BpmnStandardConverter.Import(xml);
// To retain DI paths, supply the host's existing routing/geometry preparer:
var prepared = await BpmnStandardConverter.ImportAsync(xml, routingPreparer, cancellationToken);
var exported = BpmnStandardConverter.Export(document);
// Check Succeeded before using Document / Xml. Display or persist ConversionLog in the host.

Each result contains Document or Xml, Diagnostics, ConversionLog, Succeeded and HasLosses. ConversionLog contains only conversion losses: Omitted native information on export and Ignored BPMN information on import, with a stable code, message, source identity, property and optional target identity. Successful mappings are not logged. Diagnostics separately contains technical conversion errors/advisories; it does not duplicate losses or include model-validation findings. Failure returns neither a partial Document nor partial XML.

Mapping Behavior
Process roots / nested scopes Top-level processes and collaborations; owned scopes become embedded SubProcesses. No executable behavior is claimed.
Events None Start/End; intermediate Message/Signal catch/throw and Timer catch; Timer/Message/Signal Boundary Events with attachment and interruption flag.
Tasks / gateways Task, User, Manual, Service, Send, Receive; Exclusive, Inclusive, Parallel, Event-based gateways.
Flows Sequence and Message Flows, endpoint IDs, names and documentation; existing endpoint/ownership rules apply.
Participants / Pools / Lanes A standalone native Pool becomes a Participant/process. Pools assigned to one Participant become lanes of its process. Embedded SubProcess Pools become lanes. Explicit membership is authoritative; legacy process references do not infer membership.
IDs / text Valid XML IDs preserved; other native IDs encoded collision-free with diagnostics. Names and plain descriptions map to name/documentation.
DI Shape bounds, saved caption bounds, explicit label positions and ordered saved connector waypoints. Existing projection supplies Pool/Participant envelopes.

Import uses a fresh revision and deterministic native defaults. Unnamed nodes requiring a native display name use their ID, with a diagnostic. Script/Business Rule Tasks and Call Activities retain their abstract Task/flow structure while specialized behavior is logged as ignored. Transactions and ad-hoc SubProcesses retain their embedded graph as ordinary SubProcesses. Triggered Start/End events retain their base event; unsupported definitions are logged. For an Intermediate/Boundary event with several definitions, the first supported definition in XML order supplies its native kind; all other definitions are logged. Timer text is retained; on export only recognizable ISO date/duration/repeating-interval literals are classified. Untyped custom expressions are omitted with diagnostics. No Inceptus XML extensions are emitted.

Unsupported BPMN data objects/stores/associations, execution expressions, resources, messages/signals payload definitions, choreography/conversation content, nested lane hierarchy, extra diagram representations, foreign extensions and attributes are ignored and logged. Unmapped process information has no native process-object property bag and is logged as ignored; compatible defaults and neutral interchange metadata are accepted by the import profile below. Multiple documentation blocks become one plain-text description. Black-box Participants use empty native Pools; direct Participant endpoints use the existing Participant header plus an assigned Pool. The absence of a process/black-box marker is not preserved on subsequent export.

Native Code/ElementNumber, publishing metadata other than the exported definitions name, revision, custom/profile properties, unmapped semantic kinds, anchor identities, pinning, routing mode, manual-route editing intent and routing proofs are omitted and logged. Their visible geometry is converted where available. No layout, routing, file download or editor mutation runs on export.

Synchronous Import retains DI node bounds and endpoint attachment geometry, but explicitly logs omitted connector paths; normal editor attachment prepares initial geometry. Use ImportAsync for DI path retention and for Message Flow diagrams. It uses the supplied existing IConnectorRoutingStatePreparer: process layout first, then Message Flows, then supported Pool dimension intents. DI paths become Manual routes. Native minimum geometry, boundary attachment, anchor and Pool policies can normalize coordinates; changes are logged. Negative diagram origins are translated. Additional visuals use the first source-ordered representation. Missing DI uses normal layout; there is no second routing engine. Pool/Lane frame placement and font measurement are native presentation policies, so visual equality is not promised for arbitrary third-party layouts.

Import/export validate against the bundled, unmodified OMG BPMN 2.0.2 schemas offline. Namespace URIs, not prefixes, identify BPMN and DI. Export uses the standard MODEL/BPMNDI/DD namespaces and a document-specific urn:inceptus:bpmn: target namespace. Local qualified references are supported; external structural documents are not fetched. DTD/entity expansion is disabled; XML is limited to 16,777,216 characters and 128 nested levels. Document reconstruction, required ownership/reference checks and XML schema checks guard technical conversion integrity. Model validation does not run at this boundary; import requires a coherent native result. Conversion does not change the validator's rules.

Blocking cases include malformed/schema-invalid XML, duplicate identities, missing/omitted required endpoints, incompatible attachment, unresolved external structural references, ambiguous Participant/process sharing or Lane membership, cross-scope/Participant Sequence Flows, nonrepresentable Message Flow ownership, and failed native geometry preparation. Unsupported isolated content is omitted instead. The reference import produces one main Inceptus diagram, containing the Collaboration's Participants/Pools plus at most one top-level process that no Participant references through processRef. Embedded SubProcesses retain their nested scopes. More than one such unassigned process fails with BPMN_IMPORT_MULTIPLE_UNASSIGNED_PROCESSES (including names/IDs); more than one Collaboration fails with BPMN_IMPORT_MULTIPLE_COLLABORATIONS. These are Inceptus compatibility limits, not BPMN validity rules or model-quality validation. No process is selected silently and no artificial Pool is generated for this purpose. Independent DI planes use the existing geometry preparation. If an explicitly positioned unassigned node still overlaps a Pool from another plane, BPMN_IMPORT_DI_COMPOSITION_UNSUPPORTED rejects composition instead of inventing an arrangement. Synchronous import checks supplied DI bounds; asynchronous import compares prepared nodes and Pool envelopes in scope coordinates. The existing unassigned-region placement can resolve overlapping source planes, so a file rejected by the unprepared synchronous path can succeed through the normal asynchronous host import. One Inceptus main diagram can still export as several standard processes: one per effective Participant, plus one for its unassigned elements. Export mappings remain code-defined. Ordinary imported documents have no process/view selector; SubProcess breadcrumbs remain available, and legacy native documents with peer root scopes retain their scope selector. Round-trip tests compare supported types, names/descriptions, containment, membership, topology and representable DI; they do not use XML bytes or whole DocumentSnapshot.Equals() as the interchange criterion.

The source Demo offers compact Import and Export format menus: Inceptus JSON (full fidelity) and BPMN 2.0.2 (potentially lossy interchange). BPMN import uses .xml (.bpmn remains an accepted alias), accepts files up to 16 MiB and uses ImportAsync with the existing routing preparer, notation registrations and bundled browser font measurements. The host passes the prepared snapshot to SetDocumentAsync; failed conversion or edits made during preparation leave the current document intact. BPMN export converts the current snapshot and downloads UTF-8 document.xml with MIME type application/xml;charset=utf-8 without acknowledging a native save. Neither workflow invokes diagram validation. The dismissible host feedback panel separates Conversion losses (Omitted/Ignored) from Operation feedback (technical conversion/read/download failures and advisories). Explicit Validate alone creates the host validation report. The host toolbar shows Not validated until a current report exists, then replaces it with clickable Errors / Warnings / Info counts that open the existing dismissible Issues panel (including a zero-issue report). Editing or changing scope invalidates the report and hides the counts again; it does not run validation automatically. Publish retains its existing validation and publication behavior.

Bpmn202ImportProfile.xml is the authoritative declarative policy for interpreting BPMN 2.0.2 during import. It uses namespace urn:inceptus:bpmn:import-profile:1, profile version 1, standard BPMN, and standard version 2.0.2. BPMN export is code-defined and is not configured by the import profile. The adjacent Bpmn202ImportProfile.xsd validates the vocabulary; the loader also rejects conflicting rules, unresolved/unknown element QNames, unknown attributes and unsupported action/strategy combinations. Both files are embedded in the integration assembly. BpmnImportProfile.Default loads and validates once into immutable typed ImportRules. The BpmnImportProfile XML root directly contains Fallback, Element and Transformation rules; there are no direction wrappers, Export bindings, or reserved Export configuration. Elements match namespace URI plus local name, independently of the prefixes in imported XML. DTDs and external entities are prohibited, and profiles are limited to 1,048,576 characters.

The profile distinguishes actual source-information loss from compatible BPMN defaults. exporter/exporterVersion are neutral metadata; non-executable/open processes, processType=None, horizontal Pool/Lane shapes, ordinary Activities, ordinary SubProcesses and the default Event-Based Gateway properties do not generate losses. Non-default unsupported execution properties retain the base structure and report only the lost property. Boolean 0/1 and equivalent whole-number lexical values are compared by value. Plain documentation text is mapped; other text formats retain text and report formatting loss. Gateway direction is accepted when it matches retained Sequence Flow topology (multiple incoming/outgoing flows determine Converging/Diverging/Mixed); disagreement is reported. Missing Code/ElementNumber uses the existing deterministic native policy without a routine warning. Required native name fallbacks and exceptional preparation advisories remain separate diagnostics.

action defines how imported source information is treated. The optional Report independently defines whether that treatment represents a reportable loss of source information. No Report means no loss entry; a Report disposition="Ignored" produces an import loss. There is no explicit None disposition and no Omit action. The general conversion-result contract retains Omitted for code-defined export losses.

Profile action Treatment
Map Use an existing converter binding to retain source information.
AcceptDefault Accept the native/default assumption.
AcceptMetadata Accept neutral standard interchange metadata.
AcceptDerived Verify derivability using the code-defined topology strategy; use the optional report on disagreement.
Normalize Use the existing native normalization.
Degrade Use an existing supported base mapping.
Ignore Ignore the unsupported or intentionally irrelevant information.

Default policy examples:

Source Action Report
Pool/Lane isHorizontal missing or true AcceptDefault None
Pool/Lane isHorizontal=false Normalize to horizontal Ignored: vertical orientation changed
Process isExecutable missing or false AcceptDefault None
Process isExecutable=true Ignore execution semantics, retain Process Ignored
definitions.exporter / exporterVersion AcceptMetadata None
dataObject Ignore Ignored: unsupported data information

For an alternate policy that deliberately considers a supported ignore binding irrelevant, <Behavior action="Ignore" /> is silent. Adding an Ignored Report to that same Behavior changes only loss reporting, not the treatment. Similarly, Normalize without Report is silent and should be chosen only when the normalization is semantically equivalent from the host's perspective. The shipped default still reports unsupported data and meaningful geometry changes.

Each Element selects namespace-qualified names via qnames; a list shares inherited Activity/Gateway rules without copying them. Disjoint blocks for the same QName merge; conflicting duplicate attributes, behaviors or normalized values fail explicitly. Attributes use Missing, explicit Value and Any rules. Only finite typed contexts/strategies are supported; the profile contains no scripts, expressions or executable method names. Structural relationships and geometry formulas remain in code; profiles cannot override required identity/reference bindings. Existing export mappings and geometry algorithms are unchanged.

Reports have stable codes and Element/Owner/Diagram/Document scopes. Pool-local coordinate normalization is reported once per owning Pool with its name/identity, not once per child. Deduplication uses code/scope/identity/property, not message text. Other contextual rules may aggregate by owner, diagram or document. Catch-all reports stay per element/property; broader aggregation without a contextual binding is rejected explicitly. Distinct anonymous XML losses keep their source locations. Other unclassified source attributes/elements still use an explicit Ignore fallback; XML namespace/schema-location mechanics are excluded. Unclassified execution expressions, extension contents, nested lane hierarchy and additional DI semantics still require future explicit classification; they are not silently declared compatible. Existing geometry/attachment/path transformations are detected by the established converter checks; their optional reports are defined by import Transformation rules. The refinement moved the existing negative-origin, boundary-position, connector-endpoint and connector-path reports into these rules without changing their conditions, codes, messages or geometry algorithms.

Hosts/tests may load an alternate immutable profile without changing converter internals:

var profile = BpmnImportProfile.Load(xmlProfileText); // or Load(stream), leaves stream open
var result = await BpmnStandardConverter.ImportAsync(xml, routingPreparer, profile, cancellationToken);
var imported = BpmnStandardConverter.Import(xml, profile); // synchronous, without DI routing preparation
var exported = BpmnStandardConverter.Export(document); // no profile dependency or overload

Invalid configuration throws FormatException before conversion. Alternate profiles can change supported classifications, report codes/messages and aggregation; they cannot introduce new semantic construction or geometry algorithms. The profile does not perform model validation. Parsing, reference/attachment integrity, ownership, semantic construction and routing preparation remain in converter code. ConversionLog still contains only Ignored/Omitted losses; technical failures remain in Diagnostics, and explicit host Validate independently owns model-quality findings.

The 0.1.9 native v2 reader also accepts optional connector-anchor normalizedPosition and visual-model documentRoutingStates fields. They are written only when used; absent fields retain the previous defaults. Older v2 readers reject these new fields, so the unchanged format number does not imply backward-reader compatibility for documents using them. No v1 migration is included.

Publish a standalone presentation

PublishingPackageGenerator.Generate(document, presentation) creates the existing self-contained ZIP from a canonical document and matching immutable presentation capture. The capture preserves active scope and transient visibility, which are intentionally absent from the document. The generator does not need an editor instance, perform downloads or edit metadata. The reference host's Publication dialog can save changed valid metadata through one persistent editor command before generating the artifact; a later publication rejection does not undo that save.

Document-level Collaboration publication remains unsupported. Process views may include valid Message Flows between different effective Participants. Receive Tasks cannot send and Send Tasks cannot receive. Pool/Participant endpoints and incoming Boundary Message Event delivery are graphical-only for animation and return authoring warnings. Invalid canonical endpoints still prevent publication. Communication links never become executable Sequence Flow.

The existing two-argument Generate overload remains available and uses Pools OFF and Fit Entire. The options overload controls each generated artifact:

var options = new BpmnPublishingOptions
{
    IncludePools = true,
    InitialViewMode = BpmnPublishingInitialViewMode.FitEntireDiagram,
};
var result = new PublishingPackageGenerator().Generate(document, presentation, options);
// Inspect result.Succeeded and result.Diagnostics before downloading result.Package.

For BpmnPublishingInitialViewMode.CurrentEditorView, supply an EditorView of type BpmnPublishingEditorView(DocumentId, Revision, ScopeId, VisibleRegion). Obtain the document-coordinate VisibleRegion from the live CaptureEditorContext().Presentation.EditorState.Viewport.VisibleDocumentRegion, with the matching document/revision and active ProcessScopePresentationContext. Require a ready editor and nonempty surface/region. A detached publishing Scene is not the editor viewport authority. Guard the attachment version, document, scope, viewport, surface and visibility through asynchronous capture and reject stale or unavailable context; do not silently fall back to Fit Entire. If saving publication metadata advances revision, accept only that expected metadata command and recheck the same attachment/view against the returned snapshot before generating. The reference dialog defaults to Current Editor view; hosts can offer both modes independently of Include Pools. Changing either option does not persist document data or enter History.

The artifact remains Inceptus.PublishedProcess, formatVersion 1, with these entries:

index.html
process.json
process.data.js
inceptus.publish.js
styles.css

process.data.js contains the same PublishedProcess object as process.json. Classic scripts and static bootstrap data allow static HTTP hosting and direct-file startup without fetching JSON at runtime. Keep the generated files together with their matching viewer. The standalone output needs no authoring host, source checkout, Blazor, .NET or WASM runtime. Browser/security policy may restrict local file:// access.

Publication metadata and element descriptions are captured as data. Descriptions are not displayed by the viewer. Node geometry and connector routes are frozen. Pool graphics are omitted by default; IncludePools can include representable captured Pool/Lane graphics without including the Unassigned region. Initial View changes framing only: existing API calls fit the complete diagram, while the internal Publish dialog defaults to the current Editor view. Diagram editing is unavailable; pointer drag and wheel/touchpad pan, and +/- controls zoom the model.

Initial framing adapts to the viewer viewport. After the user pans or zooms, resizing preserves that manual view. Include Pools retains captured boundaries and headers without reconstructing Pool geometry or changing token execution.

Publication requires one or more Start-role nodes in the active scope. Reachable paths from every Start are included without cloning shared identities; existing node and connector validation remains authoritative. With multiple Starts, the user selects a Start in the diagram; the toolbar does not choose one or start all of them. Repeated activations create independent tokens sharing gateway queues.

The generated execution metadata describes supported message routes, receiver Activities and attached boundary triggers for the embedded runtime:

  • Ordinary Activities process each Sequence Flow activation for 2 seconds before producing one ordinary output. A visible SubProcess behaves as an Activity; the viewer does not execute its nested contents.
  • Message Throw sends on each supported outgoing Message Flow and continues its Sequence Flow when present. Each Activity completion sends on every supported outgoing Message Flow alongside its ordinary output. Blue diamonds follow the complete frozen route, including Manual bends; delivery occurs at the receiver. Message Catch immediately continues for each arriving message without enabling.
  • A message-receiving Activity is enabled once by Sequence Flow; enabling alone produces no output. Messages received beforehand remain queued. An enabled idle receiver takes all pending messages into a fixed batch: N messages produce N ordinary outputs and N messages on each outgoing Message Flow after 2 seconds. Arrivals during processing form a later batch. Enablement survives successful output until reset or an interrupting boundary; later batches need no new token.
  • An eligible empty receiver waiting cycle can fire Boundary Timer once, using a supported duration clamped to 1–5 seconds or a 3-second presentation fallback. Message arrival cancels its timer. Boundary Signal fires automatically once, without an external signal, and takes priority over Timer. CancelActivity=true disables the receiver while retaining pending messages; false keeps it enabled. Ordinary Activities without incoming Message Flow have no idle fallback cycle.
  • Successful Activity output disables every attached boundary for that cycle, cancels timers and produces no automatic Boundary Message notification or later idle Signal. Idle state alone does not rearm boundaries. A fresh explicit Sequence Flow activation can reopen an eligible receiver waiting cycle.
  • Exclusive joins pass each incoming token through immediately. Parallel Gateways consume one token from every input and emit one on every output. Nonparallel splits choose one random output without evaluating conditions; other supported nonparallel joins use simplified pairwise merging of distinct inputs. Message Flows never contribute gateway inputs.

Orange Sequence Flow tokens and blue messages use frozen path length at 300 diagram units per second, with a 150 ms minimum for nonzero routes. Zero-length continuations are immediate. Logical timestamps determine ordering independently of rendering frequency; a message arriving at the timer deadline wins. Runtime reset clears execution state without changing input data. Bounded token and iteration guards protect the viewer from runaway diagrams.

The viewer uses a custom presentation animation model. It has no message payload, correlation engine, broker or external transport and does not implement complete BPMN execution semantics or the future SimulationEngine. Regenerate old ZIPs to obtain this runtime: each archive contains its own immutable data and viewer.

Host Publish failures and warnings remain visible outside the closed Publication dialog, with returned reasons and affected identities when available. Successful retry or session replacement clears obsolete feedback. These diagnostics belong to the editor and are not copied into the published model or shown by its viewer. Feedback is transient and does not enter Document History or persistent Issues.

Advanced and implementation-facing surfaces

Lower-layer APIs support deliberate headless or browser/session composition, with their own ownership and extension contracts. The modeler's RCL remains the ordinary composition authority. Historical BpmnPluginRegistration milestone selectors are advanced historical compositions, not interchangeable support levels; the ordinary RCL currently uses N100 and adds Organizational independently.

IBpmnModelerStartupDocumentProvider.GetInitialDocumentAsync(CancellationToken cancellationToken = default) returns ValueTask<Inceptus.DiagramEngine.Runtime.Documents.Document>. This advanced startup-only seam transfers ownership of a fresh Document per component; it is not a live model handle, replacement callback or persistence service. Prefer InitialDocument for ordinary startup.

The publicly generated DocumentCanvas and ToolboxPanel components are implementation-facing. Their visibility does not make them supported alternatives to the public DiagramEngine modeler. The standalone PublishedTokenRuntime.activateStart(startId, atMs) method and frozen startNodeIds observation are advanced runtime integration surfaces; use the artifact's matching runtime. Viewer gesture helpers, startAt and control wiring are implementation-facing, not ordinary modeler APIs or a separate stable JavaScript SDK.

Support limits and release identity

Support covers standalone Blazor WebAssembly. It does not establish Interactive Server support, every browser/device, full BPMN XML interoperability, arbitrary cross-version API compatibility or production workflow execution. Native Inceptus.Document and standalone PublishedProcess are distinct formats.

An ID/version identifies immutable distributed package bytes. Source stepping requires the matching published portable symbols and publicly retrievable source; a breakpoint in application code alone does not verify package source stepping.

First-party code is licensed under MIT, Copyright (c) 2026 Inceptus Robert Prokopczuk. Redistributed third-party material retains its own terms; see third-party notices, including the separately bundled DejaVu font license. See release notes. These documents are also included in each primary package.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Inceptus.DiagramEngine.Contracts:

Package Downloads
Inceptus.Bpmn.Integration

Document serialization, compatibility, validation and publication integration for Inceptus BPMN hosts.

Inceptus.DiagramEngine.Organizational

Organizational Profile semantics and plugin contributions for the Inceptus Diagram Engine.

Inceptus.DiagramEngine.Bpmn

BPMN notation semantics, commands, validation, and plugin contributions for the Inceptus Diagram Engine.

Inceptus.DiagramEngine.Runtime

Headless document, command, history, projection, layout, routing, validation, and native persistence runtime for the Inceptus Diagram Engine.

Inceptus.DiagramEngine.Canvas2D

Canvas2D browser editing session, interaction, scene, and renderer integration for the Inceptus Diagram Engine.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 140 11/18/2026
1.1.2 167 11/13/2026
1.0.0 159 11/9/2026

## 1.2.0

- Adds passive application decorations and presentation refresh through the public
 modeler in Editable and ReadOnly. Text-only, SVG-with-text and SVG-only messages
 can coexist on one native element, with independent message identities and coherent
 collection updates/removal. Attachment and input revisions guard stale updates;
 passive content does not alter native documents, geometry, History or exports.
- Adds an application-owned action integration for the engine-rendered Smart
 contextual toolbar and popup menu. Applications supply definitions, icons,
 availability and handlers. The floating toolbar displays icons with accessible
 names; popup items retain text and disabled explanations. Toolbar enablement is
 independent of popup availability and native Smart Edit. Selection and explicit
 popup targets remain distinct, with guarded dispatch and stale-request retirement.
- Supports monotonic application-action revisions, optional typed handling outcomes
 alongside the existing legacy callback, and explicit toolbar reactivation after
 dismissal. Applications retain ownership of dialogs, domain data and persistence;
 ReadOnly does not gain native editing capability.
- Removes the popup's visible application-action heading, reserved heading space
 and unconditional leading separator. Separators appear only between non-empty
 groups; native action eligibility and accessible action labels are preserved.
- Organises the source Demo into Editable, ReadOnly and Simulation modes with a
 grouped mode selector. ReadOnly automatically displays native selection information
 and offers graphical export only. Simulation demonstrates application actions,
 composite annotations and illustrative operational information using the same
 native ReadOnly modeler, without a simulation runtime or persistent profiles.
 Optional maintenance controls remain separate from ordinary examples.
- Corrects transient resize status reporting, host cleanup/native-save completion
 and ordered callback verification. Demo panels retain access to native zoom
 controls across supported layouts.
- Aligns all seven packages at **1.2.0**. Canvas2D requires Runtime **[1.2.0]**;
 other family dependencies retain their minimum-version ranges. SDK **10.0.403**,
 **net10.0**, native `Inceptus.Document` formatVersion **2** and standalone
 `Inceptus.PublishedProcess` formatVersion **1** remain unchanged. No document
 migration or process-execution change is introduced.
- Physical mobile-device, touchscreen and laptop-touchpad compatibility remains
 unverified. Browser simulation and automated coverage do not establish physical
 device compatibility. These notes describe the candidate, not package availability.