while updating the name of the sequenceFlow, by updating the businessObject(e.g., element.businessObject.name = ‘xyz’), the object gets updated but the same is not reflected in the canvas.
and when using updateProperties, we are facing challenges doing undo & redo.
Please suggest any other way to update the name of the sequence flow
There is a scenario where we have a custom property panel and the label of sequenceFlow.
when I update the property in custom property panel, the updated property should be shown as label for sequence flow, as well as the generated xml should be updated with the custom property.
There are two steps involved
update the property panel which should be updating the xml.
update the sequence flow label.
Both steps use ‘updateProperties’ api to get the xml with updated property and for label updation in sequence flow.
But from user perspective it is only custom property panel change. When he changes property , sequence flow name should be updated as per user entry.
eg: customPropValue = “expression - 1”; (updating a value in custom property panel)
Expectation: it should be reflected in xml as well as label for sequence flow.
Current: it is reflected in xml but not label of sequence flow.
When do an undo operation for one time, it should revert both the xml change as well as label of sequence flow
Yes. The requirement is to show the user entered property as name/label of the sequence flow, similar to the below diagram/example (“book is loan” & “book is available” label/name of sequence flow)
Because, the label should be the data entered by user. which means, the label is not static and hence its dynamic.
And user can changes it using the custom property.
And the action can be done n-number of times.
adds a model extension that allows sequence flows to have a score attribute
adds a command interceptor that sets the sequence flow label to Score: {score} whenever the score attribute is changed
add interaction to edit the score attribute
Note that using a command interceptor is a way of executing additional commands before or after a particular command is executed. These additional commands will also be reverted when the original command is reverted. From the users point of view there’s only one command. Pressing CmdOrControl+Z once will undo all commands.