I am developing an extension of bpmn-js to allow the management of temporal attributes.
In such an extension, each bpmn:SequenceFlow has an extended property ‘duration’ composed of two fields: ‘min’ and ‘max’. ‘min’ and ‘max’ can be edited in a tab of the property panel.
I am trying to add a read-only label ‘[min, max]’ beside the ‘name’ label of a SequenceFlow.
Such a label mustn’t be edited directly, but it should be updated automatically every time min/max are updated in the property panel.
I can add a method that maintains the update string ‘[min, max]’ as an attribute of SequenceFlow if this simplifies the setting.
If I use ‘modeling.createLabel()’ passing the businessObject of the considered connection,
the resulting label is a label associated with the ‘name’ field of the businessObject, and it is editable.
It seems that:
- it is not possible to make it read-only
- it is not possible to associate it with another field of businessObject
Is there a clean way (clean=foreseen by the system architecture) to implement the above kind of label?
I have tried to customize some modules that manage Labels, but I wasn’t able to build a working mechanism.
I am not able to understand the following:
- which files I have to customize without losing the standard feature of ‘name’ label management.
- how to integrate them
- the creation of the label should be triggered when event ‘connection.create’ or ‘connection.add’ occur,
but it seems that CommandInterceptor can manage only ‘connection.create’.
So, when I load an XML diagram, labels are not created.
Any hints/roadmap/link to document is very appreciated.