Custom activities in Camunda Modeler


#1

Hello,
In our company we would like to offer a custom library of BPMN activities for non-programming people.In the underlying XML the custom activities would render as ordinary ServiceTask or CallActivity but we would like to have a good control over how the XML is created.
I have tried Element Templates which is a great feature and covers a lot of our use cases but there are some examples where we are hitting the wall or have to do workarounds.
It would be great if we could create a custom activity and then define how the XML code for that activity is rendered.
The only things I see problematic are the bpmn:incoming and bpmn:outgoing elements.

Is there any existing solution for this?
Thank you


#2

Hi @jiri.halaska,

Indeed this is a little bit trickier via element templates. For adding custom type of elements + adding the way how they are serialized to the XML you will have to create custom elements for the underlying bpmn-js modeling library. You can have a look on this example for a starting point.

After creating your custom elements it is possible to include them in the Modeler via bpmn-js-extension via plugin. The example above + the plugin documentation should offer what it needs.


#3

Thank you Niklas, this seems promising. I will give it a shot.