camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.51k stars 484 forks source link

Warn about missing BPMN Shape #4277

Closed korthout closed 6 months ago

korthout commented 6 months ago

Problem you would like to solve

I was not warned by Modeler that the diagram was missing a BPMN Shape for a process element.

Specifically, there was no <bpmndi:BPMNShape> for this:

<bpmn:sequenceFlow id="Flow_1d8avtw" sourceRef="Activity_1ipwzk8" targetRef="Activity_0ll9m9k" />

Proposed solution

Warn the user with a problem stating that the process model has an item not visible in the diagram, and which item.

Alternatives considered

Pay really good attention to the XML :)

In all honesty, another option is for Zeebe to reject models where the visual diagram does not provide a shape for each element in the process. There are several issues with this:

Additional context

I investigated a process instance that unexpectedly had an extra token after a parallel gateway. This made us think we had a bug in the engine.

After detailed root causing, I discovered that Zeebe executed the process instance correctly. There was a rogue Sequence Flow by passing the Parallel Gateway in the bpmn process (XML), but the visual diagram did not contain a BPMNShape for this item.

barmac commented 6 months ago

We could get this for free if we enable bpmnlint:recommended ruleset per default.

Otherwise this can be achieved via a plugin: https://github.com/camunda/camunda-modeler-custom-linter-rules-plugin

nikku commented 6 months ago

@barmac Lightweight alternative to be considered: Add only the no-bpmndi rule. I think it is an important safeguard; at best it will save our users a bunch of time to root cause bugs.

nikku commented 6 months ago

Moving to ready to discuss with the team.