Bpmn-js add extensionElements

Hello,

i wanted to ask if someone can explain me how i can add custom extensionElements (propery type=“mode” value=“on”) programmically to an custom bpmn-js project.

I achieved to add a custom Task directly from the palette but now i am stucking here.

I read that i can somehow reference the businessObject and call getExtensionElements or addExtensionElements but i did not figured it out.

I jumped into all the examples like add property panel extenstion and so on but for me it is not clear how i can add custom properties to a task.


You see here in the picture that a custom task is already within the palette and also a console.log message where i see that this task did not have any children.

Maybe i can do the following: simple adding children (extensionElements → properties → property).

this is the custom code:

Thanks in Advance.
Best regards
Sebastian

Hi Sebastian,

I recommend that you post this question in the bpmn.io forum as well:
https://forum.bpmn.io/
There are many experts on working with and extending bpmn-js.

Regards,
Stephan

2 Likes

Solved in this thread:
Bpmn-js add extensionElements - Developers - Forum - bpmn.io

Thanks @StephanHaarmann

1 Like