Hi, everybody. I’m continuing to explore bpmn.io and I got stuck in this little problem regarding ExtensionElements that get created via bpmn-js-properties-panel.
The problem doesn’t show up when creating, modifying or deleting an extension. Everything is working fine. Except when whoever is using this model decides to change the type of a task that includes an extension.
I’ll explain myself better. I created this simple model:
The properties panel contains properties and attributes of the selected user task (that grey area covers some personal info), and I give to user the chance to add some custom extensions. Doing that, the XML generated looks like this:
... <bpmn2:userTask id="_manual_task" name="This is a manual task"> <bpmn2:extensionElements> <dm:priority code="2" /> <dm:category code="Category02" /> </bpmn2:extensionElements> ... </bpmn2:userTask> ...
So far, so good. Let’s imagine that I made a mistake, that should be a Manual Task (as Id and Name properties shows), so: right click with my mouse, click on wrench, select manual task. My bpmn looks like this:
While my XML looks like this:
... <bpmn2:manualTask id="_manual_task" name="This is a manual task"> <bpmn2:extensionElements> <dm:priority code="2" /> <dm:category code="Category02" /> </bpmn2:extensionElements> ... </bpmn2:manualTask> ...
And this where I notice for this first time that a change of task do not clean up existing extensions. Priority and Category are not selectable in a manual Task so, in order to keep the code clean and avoid problems, I’ve to take them away.
Question: how can I do that?
I tried to find some solution by myself, especially with changedElement listener of eventBus, but that means that I risk to clean up extensions at any editing action. Does anybody has a suggestion for me? Is there something missing or a workaround I can use?
Thanks in advance!