Skip to content

feat(studio): make bpmn-js the default BPMN designer - #9038

Merged
sfmskywalker merged 1 commit into
mainfrom
feat/bpmn-js-default
Oct 22, 2026
Merged

sfmskywalker merged 1 commit into
mainfrom
feat/bpmn-js-default

Conversation

@sfmskywalker

@sfmskywalker sfmskywalker commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Purpose

Step 5 of #8927 (epic #8898). With BPMN editing (#9031, #9034), creating BPMN workflows (#9036) and the viewers (#9037) all running through the designer contract, the workflows module now uses bpmn-js. Hosts no longer have to enable a BPMN designer themselves. This follows the selectable-designers ADR: "When a host enables none, the Studio's BPMN feature enables bpmn-js."


Scope

  • New feature

Description

Problem

BpmnDesignerResolver returned no designer unless the host called AddBpmnJsDesigner() (or enabled another designer). No packed module did, so out of the box every host kept the read-only X6 BPMN view, and the designer work was unreachable. Elsa.Studio.Bpmn.BpmnJs was not packable.

Solution

  • Elsa.Studio.Bpmn.
    • New DefaultBpmnDesigner record and AddDefaultBpmnDesigner(descriptor).
    • The resolver falls back to the default only when the host enables no designer. BpmnDesignerOptions.DesignerId may name the default.
    • The default is never counted as enabled. A host that enables any designer uses its own designers and never has to choose between them and the default.
    • Only the first default registered counts.
  • Elsa.Studio.Workflows.
    • References Elsa.Studio.Bpmn.BpmnJs.
    • AddWorkflowsModule registers bpmn-js as the default. Its script still loads only when a BPMN canvas opens.
  • Packaging.
    • Elsa.Studio.Bpmn.BpmnJs becomes packable, as Elsa.Studio.Bpmn did in feat(studio): edit a BPMN workflow's document in the enabled BPMN designer #9031. A packed Elsa.Studio.Workflows now depends on it.
    • Its bundle (bpmn-js-designer.js, .css) joins the packaged browser-asset checks: CLIENTLIB_ASSETS in prove_consolidated_packages.py, and STUDIO_CONTENT in validate_packages_id_set.py. A pack built without the bundle now fails instead of shipping a default designer whose script 404s.
    • build_studio_clientlibs.sh already builds it.
  • Solution filters. Regenerated; BpmnJs joins Elsa.AI, Elsa.Extensions and Elsa.Integrations.
  • Docs. The contract spec's designer-selection table describes the default.

Public API

The changes are additive:

  • DefaultBpmnDesigner;
  • AddDefaultBpmnDesigner;
  • a BpmnDesignerResolver constructor that takes the default.

The existing two-parameter constructor remains.

Consequences reviewers should weigh

  • Hosts lose the read-only X6 BPMN view by default.
    • Until the X6 designer module (step 6) exists, there is no supported switch back to it.
    • UseReactFlow still shows its notice for BPMN, as before.
    • The X6 view remains for BPMN scopes that have no source document.
  • Every host gets the BpmnJs assembly and its static web assets. The script itself loads lazily.
  • The release gains the Elsa.Studio.Bpmn.BpmnJs package.

Verification

  • dotnet test studio/src/modules/Elsa.Studio.Bpmn.Tests: 31 passed.
  • dotnet test studio/src/modules/Elsa.Studio.Workflows.Tests: 603 passed.
  • New tests.
    • Resolver:
      • the default is used when none is enabled, and may be named;
      • naming another designer fails;
      • an enabled designer replaces the default;
      • the first default wins;
      • the startup check passes with only a default.
    • WorkflowsModuleBpmnDesignerTests:
      • the module resolves bpmn-js;
      • a host's own designer replaces it with no ambiguity error.
  • Mutation checks. Returning null in place of the default fails two resolver tests. Registering only the resolver in AddWorkflowsModule fails the module test.
  • Updated tests. Tests that cover the read-only canvas (BpmnEditingTestServices, BpmnNestedScopeDrillDownTests, and the create test's no-designer case) now remove DefaultBpmnDesigner. That is the only configuration in which no designer resolves.
  • Scripts. python3 -m unittest scripts/test_validate_packages_id_set.py passes. So do test_prove_consolidated_packages, run from scripts/integration-program, and test_prove_consolidated_package_consumers.
  • Solution filters. python3 scripts/solution/solution_groups.py --check is clean.
  • Build. dotnet build of Elsa.Studio.Workflows on net8.0, net9.0 and net10.0: no errors.

Screenshots / Recordings (if applicable)

Not applicable: no new UI. The viewers and editor that now become the default were added in #9031, #9034, #9036 and #9037.


Checklist

  • The PR is focused on a single concern
  • Commit messages follow the recommended convention
  • Tests added or updated (if applicable)
  • Documentation updated (if applicable)
  • No unrelated cleanup included
  • All tests pass

Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • The BPMN.js designer is now selected automatically when no other BPMN designer is enabled.
    • When another designer is enabled, it takes precedence over the default.
  • Bug Fixes
    • BPMN.js designer assets are now included in studio packages, helping ensure the designer is available when deployed.

The workflows module now registers bpmn-js as the default BPMN designer, as the
selectable-designers ADR decides: a host that enables no designer gets bpmn-js,
and a host that enables any designer uses that one without having to choose
between it and the default.

- Elsa.Studio.Bpmn: DefaultBpmnDesigner and AddDefaultBpmnDesigner. The resolver
  falls back to the default only when no designer is enabled; the options may
  name it. Its existing constructor stays.
- Elsa.Studio.Workflows references Elsa.Studio.Bpmn.BpmnJs, which becomes
  packable, and its bundle joins the packaged browser-asset checks.
- Tests that cover the read-only canvas take the default out, since that canvas
  is what a host gets when no designer resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfQ8xsHYWP9ZvKcGTTEe1B
@sfmskywalker sfmskywalker added this to the 3.11 milestone Oct 22, 2026 — with Cursor
@sfmskywalker sfmskywalker added enhancement New feature or request elsa 3 This issue is specific to Elsa 3 area:studio Quality loop area: studio prio medium labels Oct 22, 2026 — with Cursor
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 10048608-29e1-41cb-beac-cdb66806b847
📥 Commits

Reviewing files that changed from the base of the PR and between 62e56a1 and 51981fa.

📒 Files selected for processing: 18
  • Elsa.AI.slnf
  • Elsa.Extensions.slnf
  • Elsa.Integrations.slnf
  • scripts/integration-program/prove_consolidated_packages.py
  • scripts/test_validate_packages_id_set.py
  • scripts/validate_packages_id_set.py
  • studio/docs/specs/bpmn-designer-contract/contract.md
  • studio/src/modules/Elsa.Studio.Bpmn.BpmnJs/Elsa.Studio.Bpmn.BpmnJs.csproj
  • studio/src/modules/Elsa.Studio.Bpmn.Tests/BpmnDesignerResolverTests.cs
  • studio/src/modules/Elsa.Studio.Bpmn/Designers/BpmnDesignerResolver.cs
  • studio/src/modules/Elsa.Studio.Bpmn/Designers/DefaultBpmnDesigner.cs
  • studio/src/modules/Elsa.Studio.Bpmn/Extensions/ServiceCollectionExtensions.cs
  • studio/src/modules/Elsa.Studio.Workflows.Tests/BpmnNestedScopeDrillDownTests.cs
  • studio/src/modules/Elsa.Studio.Workflows.Tests/Support/BpmnEditingTestServices.cs
  • studio/src/modules/Elsa.Studio.Workflows.Tests/WorkflowDefinitionListBpmnCreateTests.cs
  • studio/src/modules/Elsa.Studio.Workflows.Tests/WorkflowsModuleBpmnDesignerTests.cs
  • studio/src/modules/Elsa.Studio.Workflows/Elsa.Studio.Workflows.csproj
  • studio/src/modules/Elsa.Studio.Workflows/Extensions/ServiceCollectionExtensions.cs
💤 Files with no reviewable changes: 1
  • studio/src/modules/Elsa.Studio.Bpmn.BpmnJs/Elsa.Studio.Bpmn.BpmnJs.csproj

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

📝 Walkthrough

The resolver now supports a default BPMN designer when no designer is enabled. The workflows module registers bpmn-js as that default. Solution filters and package validation now include the Bpmn.js project and its browser assets.

Changes: BPMN Designer Selection and Packaging

Layer / File(s) Summary
Default designer contract and resolution
studio/src/modules/Elsa.Studio.Bpmn/Designers/*, studio/src/modules/Elsa.Studio.Bpmn.Tests/BpmnDesignerResolverTests.cs, studio/docs/specs/bpmn-designer-contract/contract.md
The resolver uses a registered default when no designer is enabled. A configured designer ID must match that default. Enabled designers take precedence. Tests cover these selection rules and default registration behavior.
Workflow module registration and validation
studio/src/modules/Elsa.Studio.Workflows/Extensions/ServiceCollectionExtensions.cs, studio/src/modules/Elsa.Studio.Workflows/Elsa.Studio.Workflows.csproj, studio/src/modules/Elsa.Studio.Workflows.Tests/*
The workflows module registers bpmn-js as the default designer and references its project. Tests verify designer selection and remove the default registration in cases that exercise no-designer behavior.
Bpmn.js project and browser asset packaging
Elsa.AI.slnf, Elsa.Extensions.slnf, Elsa.Integrations.slnf, scripts/*, studio/src/modules/Elsa.Studio.Bpmn.BpmnJs/Elsa.Studio.Bpmn.BpmnJs.csproj
The solution filters include the Bpmn.js project. Package checks require its designer JavaScript and CSS assets. The project no longer sets IsPackable to false.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant WorkflowsModule
  participant ServiceCollection
  participant BpmnDesignerResolver
  WorkflowsModule->>ServiceCollection: Register BpmnJsDesigner.Descriptor as default
  ServiceCollection->>BpmnDesignerResolver: Supply enabled designers and registered default
  BpmnDesignerResolver-->>ServiceCollection: Select enabled designer or default
Loading

Possibly related issues

  • elsa-workflows/elsa-core issue 8929: The PR establishes the shared bpmn-js module reference and default-designer contract, but React hosting remains separate work.
  • elsa-workflows/elsa-core issue 8927: The PR implements the specified default-selection behavior when no designer is enabled.
  • elsa-workflows/elsa-core issue 8898: The PR makes bpmn-js the default when no designer is enabled.
  • elsa-workflows/elsa-core issue 8928: The PR makes bpmn-js the workflows module’s default while enabled designers take precedence.
  • elsa-workflows/elsa-core issue 8725: The PR adds Bpmn.js package inclusion and browser asset validation, but does not complete release publishing.
  • elsa-workflows/elsa-core issue 8198: The PR adds package-content validation for Bpmn.js assets, but does not implement independent versioning.
Merge Risk: ⚪ Minimal · up to 51981

The default designer and its packaged assets appear ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 12 files. (5 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: making bpmn-js the default BPMN designer in Studio.
Description check Passed The description follows the required template and includes the purpose, scope, problem, solution, verification steps and results, applicability of screenshots, and checklist. It also documents API, pa…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description follows the required template and includes the purpose, scope, problem, solution, verification steps and results, applicability of screenshots, and checklist. It also documents API, packaging, and behavioral consequences.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 12 files. (5 skipped: 5 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No blocking findings remain; the default preserves explicitly enabled host designers, and the default-view change is intentional.

Summary

Makes bpmn-js the default BPMN designer when a host enables none.

  • Workflow hosts get bpmn-js unless they enable another BPMN designer.
  • Studio packages include the bpmn-js designer and its browser files.

The earlier package-ID finding was dismissed by sfmskywalker: validate_packages_id_set.txt is the frozen 3.10 release set, checked only for stable 3.10 candidates built from the release branch, not this main-branch feature targeting 3.11. Updating that set here would make the 3.10 guard require a package its release cannot contain. Preparation of the 3.11 package set is deferred to that release.

sfmskywalker acknowledged the loss of the default read-only X6 BPMN view as intentional: bpmn-js becomes the default, while a supported X6 designer switch is deferred to step 6. The X6 view remains for BPMN scopes without a source document.

Reviews (2) · Last reviewed commit: "feat(studio): make bpmn-js the BPMN desi..." · Reviewed by Greptile

Comment thread scripts/validate_packages_id_set.py Resolved

Copy link
Copy Markdown
Member Author

@greptileai review

The P1 is answered on its thread. validate_packages_id_set.txt is the frozen 3.10.0 set, and it is checked only for stable refs/tags/3.10.* candidates built from the release branch. This PR targets main (3.11), where Elsa.Studio.Bpmn (#9031) is already packable outside that set.


Generated by Claude Code

@sfmskywalker
sfmskywalker merged commit 8046f98 into main Oct 22, 2026
23 checks passed
@sfmskywalker
sfmskywalker deleted the feat/bpmn-js-default branch October 22, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:studio Quality loop area: studio elsa 3 This issue is specific to Elsa 3 enhancement New feature or request prio medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant