Add a label on a custom element


#1

Hi all,

We’re working on an implementation of a tool that uses bpmnjs at the moment, and have our custom elements rendering on the page. I’d like to be able to add labels to our custom elements in the same way you can with other elements, so that they are meaningful in the diagram. I have seen the topic here;

but there is limited information on how this is actually achieved. Do we have to implement a completely custom LabelEditingProvider, or is there a way to just add our custom element type to the list of types that can be labelled?

Any help would be much appreciated!

Thanks


#2

Hi Ben,

indeed, to achieve your goal you should implement LabelEditingProvider. There is currently no API to add elements allowed to be labelled.

Best,

Maciej


#3

Hi Maciej,

That’s great, thanks for the info. Do you know if there are any good examples I can reference for adding a LabelEditingProvider please?

Thanks,

Ben


#4

The bpmn-js LabelEditingProvider is a good example.