feat: render event subprocess icons#2293
Conversation
|
There is one bug: When the start event type changes, the icon is not updated. It's only updated when the collapsed subprocess is moved afterwards. I have no idea how to fix this. Do you? Either way I'd like to argue that this is a separate issue that can be fixed separately, because modeling collapsed event subprocesses is not promoted by bpmn-js and users are unlikely to encounter this problem. |
|
Hi @sombrek! Thanks for your contribution.
The renderer is reactive in a sense that it redraws only the elements which it is prompted to redraw. The elements are passed by the Command Stack, and it receives them from the Command Handlers (e.g. https://github.com/bpmn-io/diagram-js/blob/develop/lib/features/modeling/cmd/CreateShapeHandler.js#L65). I checked and the event subprocess is not passed when event is replaced, and that's why it's not redrawn. So the solution would be to mark the event subprocess as dirty when its child start event's type changes. It can be difficult since we are in a different diagram then the one where we need to redraw. |
|
@sombrek do you still want to work on this PR? I am converting this to draft since some changes are still required, but feel free to comment/mark it as ready when you have an update. |
|
@barmac I'd like to get the PR merged, but I do not see a way to fix the remaining issue. How can re-drawing the parent diagram be triggered? |
|
Hmm if a simple solution does not work, we could as well merge the pull request, and create an issue for a missing rendering update. |
223b0e9 to
974a8b5
Compare
|
Follow-up issue: #2297 |
|
This is published in v18.4.0. Thank you @sombrek! |
|
Cool. Thanks! |

Closes #50
Draw event icons for collapsed event subprocesses.
No icon is drawn when a start event is missing or when there's more than one start event (forbidden by the spec).
Reuses existing code with few minor adjustments.
Demo (spec on the right):
event-subprocess-icons.bpmn contains all possible icons.