I’ve got another question - is there a way, and I’m sure it is, to create a shape along with a label?
I’m assuming I could use elementFactory.createLabel but what should I pass as a businessObject then and how to link them together?
Thank you in advance!
p.s. The more I dive into bpmn-js and diagram-js the more I see how cool it is.
Alright, I can inject modeling into Pallete, but I can’t use modeling.updateLabel on that step just because there is no actual element yet on a canvas so it can’t be updated.
What kind of element are you trying to create? Maybe it’s just sufficient to set the name property when creating the element, the label should be automatically created.
Yay, I’ve got it working. Thank you Niklas for pushing me in a right direction, also a huge help was that post.
It appears that passing the name property itself doesn’t work. What you want to do instead is to set the name prop for a businessObject of a shape.
Here is an example: