I’m still struggling with the connection of custom elements due to the issue that I do not exactly know how to add a context pad entry…
Along the way, I tried to add labels to the custom elements (like the label of a BPMN start event). So far, the result is the following: When I double-click on a custom element, a textbox opens and I can insert text. But the text disappears, when the textbox looses focus. Which part of the code is responsible for the feature that the content of the textbox is added as label to the element?
All in all, I need labels - that stay - and I need to verify the content of the label. For instance, I have a list of attributes (from another API) and the label has to be one valid attribute of this list.
Thanks for your help! I’m using your project as basis for the prototype of my master thesis. So, hopefully, I will be able to implement all the features in time!
The above code should override the contextPadProvider, providing only your context pad entries. It is not necessary to change any code in bpmn-js in order to update the context-pad.
As written before, labels are just normal elements. Add them once you add your custom elements. Just make sure it has the type label and a labelTarget set, pointing to the custom element that is labeled by it.
You can copy and paste from the BPMNImporter code. I suggest you to debug the whole thing at least once though in order to understand a bit of what is happening.
If you have troubles getting it working it might be simpler for you to just use internal (i.e. embedded) labels.