You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
X6 BPMN designer for the Blazor Studio (full editor) #8928
A later phase of #8898, per ADR Offer selectable BPMN designers (#8926). This comes after the bpmn-js designer ships.
Change
Turn the read-only X6 BPMN view (studio/src/modules/Elsa.Studio.Workflows/DiagramDesigners/Bpmn/) into a full editor behind the BPMN designer contract, as its own Studio module. It needs:
a palette;
BPMN connection rules: sequence flows inside a pool, message flows between pools, boundary events attached to activities;
DI for new shapes and edges, and label placement;
expanded and collapsed subprocesses, with editing at every depth;
undo and redo;
properties, using Studio's activity picker and input editors.
The X6 view stays until this designer replaces it.
The bpmn-moddle tree is the document; X6 only projects it.
Load:load(xml) runs withGeneratedLayout, then moddle.fromXML with the elsa descriptor. The document is swapped only on success, so a failed load keeps the current one.
Save:save() runs toXML(definitions, { format: true }), the serializer bpmn-js uses. Output is byte-stable, and untouched content is formatted as bpmn-js formats it.
Load warnings and preservation: load warnings come from the shared computeLoadWarnings. Foreign extensions and $attrs are preserved as they are in bpmn-js.
A canvas-neutral modeling kernel in the shared Elsa.Studio.Bpmn ClientLib (src/modeling/). It holds:
the document;
the plane/DI index;
a command stack with undo/redo and dirty tracking by state id, ported from the bpmn-js designer;
commands that change semantics and DI together;
ElementFactory;
connection, drop and attach rules;
orthogonal edge layout;
label placement.
A boundary test keeps X6 and React out of it, so the React Flow designer (#8929) can reuse it. Undo/redo lives in the kernel, not in X6's History plugin, because the X6 graph is only a projection of the document.
The Elsa.Studio.Bpmn.X6 module follows the bpmn-js module's layout (descriptor id x6, AddX6BpmnDesigner(), esbuild ClientLib with exact pins and a size budget). The "Performed by" panel already works through getBinding/setBinding for any designer, so the activity picker and input editors come for free.
Alternative rejected: using X6's graph JSON as the model, with a hand-written XML writer. It would have to rebuild every preservation rule (child order, namespaces, $attrs, planes), and its output would drift from bpmn-js formatting.
Steps (the read-only view keeps working throughout)
Kernel, part 1, plus spec and plan:
document load and save;
plane/DI index and plane view;
command stack;
updateProperties and setBinding;
Vitest round trips over the fixtures and core assets.
Elsa.Studio.Bpmn.X6 module.
It implements the full contract and draws the document, but has no editing tools yet.
CI runs the shared conformance suite (contract, host, preservation, ImportEquivalence) against it as well as against bpmn-js.
Basic editing:
move and resize with DI, with labels and waypoints following;
cascading delete;
inline name editing;
keyboard undo/redo.
Palette, creation and replace.
Sequence-flow rules, associations, edges, and boundary-event attach/detach.
Pools, lanes and message flows. Includes a check that an X6-saved document opens in bpmn-js with no warnings.
Retiring the read-only view. It now only serves definitions without Bpmn:SourceXml, which no designer can open.
BPMN properties beyond the binding (conditions, timers, message refs, cancelActivity). Neither designer can edit these in the Blazor Studio today. My recommendation is an optional contract addition in a separate issue, and a documented limit for this issue.
Pools with their own executable process. Elsa binds one process. My recommendation is black-box pools plus a documented limit.
Risk: the conformance suite tests the API, not editing gestures, so it goes green at step 2. Editing quality rests on the X6-specific Playwright tests, the kernel tests, and the cross-designer check in step 6.
[Claude] The owner has answered the spec's open questions (studio/docs/specs/bpmn-x6-designer/spec.md):
Retiring the read-only view: retire it once the X6 designer ships, as the plan's last step.
BPMN properties beyond the binding (conditions, timers, message references, cancelActivity): in scope for this issue. A new step adds a properties panel, X6-only, in the contract's propertiesContainer. It comes after subprocesses, before limits and packaging. A contract addition for other designers is not part of it.
Pools with their own executable process: draw them as black boxes and document the limit.
Where the kernel lives: still open; it does not block anything yet.
spec.md and plan.md get these in a docs PR after #9053 merges, because #9053 edits both files.
Activity
sfmskywalker commentedon Oct 24, 2026
[Claude] Plan, grounded in origin/main 1c8b885.
Architecture
The bpmn-moddle tree is the document; X6 only projects it.
load(xml)runswithGeneratedLayout, thenmoddle.fromXMLwith the elsa descriptor. The document is swapped only on success, so a failed load keeps the current one.save()runstoXML(definitions, { format: true }), the serializer bpmn-js uses. Output is byte-stable, and untouched content is formatted as bpmn-js formats it.computeLoadWarnings. Foreign extensions and$attrsare preserved as they are in bpmn-js.A canvas-neutral modeling kernel in the shared
Elsa.Studio.BpmnClientLib (src/modeling/). It holds:ElementFactory;A boundary test keeps X6 and React out of it, so the React Flow designer (#8929) can reuse it. Undo/redo lives in the kernel, not in X6's History plugin, because the X6 graph is only a projection of the document.
The
Elsa.Studio.Bpmn.X6module follows the bpmn-js module's layout (descriptor idx6,AddX6BpmnDesigner(), esbuild ClientLib with exact pins and a size budget). The "Performed by" panel already works throughgetBinding/setBindingfor any designer, so the activity picker and input editors come for free.Alternative rejected: using X6's graph JSON as the model, with a hand-written XML writer. It would have to rebuild every preservation rule (child order, namespaces,
$attrs, planes), and its output would drift from bpmn-js formatting.Steps (the read-only view keeps working throughout)
updatePropertiesandsetBinding;Elsa.Studio.Bpmn.X6module.contract,host,preservation, ImportEquivalence) against it as well as against bpmn-js.Decisions for the owner (none block steps 1 to 3)
Bpmn:SourceXml, which no designer can open.cancelActivity). Neither designer can edit these in the Blazor Studio today. My recommendation is an optional contract addition in a separate issue, and a documented limit for this issue.Risk: the conformance suite tests the API, not editing gestures, so it goes green at step 2. Editing quality rests on the X6-specific Playwright tests, the kernel tests, and the cross-designer check in step 6.
Generated by Claude Code
feat(studio): add the canvas-neutral BPMN modeling kernel, part 1 (#9050
sfmskywalker commentedon Oct 24, 2026
[Claude] The owner has answered the spec's open questions (studio/docs/specs/bpmn-x6-designer/spec.md):
cancelActivity): in scope for this issue. A new step adds a properties panel, X6-only, in the contract'spropertiesContainer. It comes after subprocesses, before limits and packaging. A contract addition for other designers is not part of it.spec.md and plan.md get these in a docs PR after #9053 merges, because #9053 edits both files.
New plan order:
Generated by Claude Code
feat(studio): add the X6 BPMN designer, drawing only, on the modeling…
feat(studio): move shapes in the X6 BPMN designer (#9055)
docs(studio): record the owner's X6 designer decisions (#9054)
feat(studio): resize shapes in the X6 BPMN designer (#9056)
feat(studio): delete elements in the X6 BPMN designer (#9057)
feat(studio): edit names in place in the X6 BPMN designer (#9059)
feat(studio): create elements from a palette in the X6 BPMN designer (#…
feat(studio): replace elements with another type in the X6 BPMN desig…
feat(studio): create and name groups in the X6 BPMN designer (#9063)