Hello everyone,
I’m working on creating custom extension elements in Camunda 8, similar to what I used to do in Camunda 7, but I’m facing some challenges.
In Camunda 7, I could define custom elements like this:
<bpmn2:serviceTask id="id_here" name="name_here">
<bpmn:extensionElements>
<customNameSpace:customParentElement>
<customNameSpace: customChildElement name="dummy" attr1="dummy" attr2="dummy" id="dummy"></customElement: customChildElement >
<customNameSpace: customChildElement name="dummy2" attr1="dummy2" atttr2="dummy2" id="dummy2"></ customNameSpace: customChildElement >
</customNameSpace: customParentElement >
</bpmn:extensionElements>
</bpmn2:serviceTask>
I would then extend ModelElementInstance
for the custom element and register it using modelBuilder
.
However, when trying to achieve the same in Camunda 8 using the Java API (Zeebe client), I noticed that there’s no modelBuilder
available to register custom elements.
The closest approach I’ve found is using TaskHeader
like this:
<bpmn:serviceTask id="collect-money" name="Collect Money">
<bpmn:extensionElements>
<zeebe:taskDefinition type="payment-service" retries="5" />
<zeebe:taskHeaders>
<zeebe:header key="method" value="VISA" />
</zeebe:taskHeaders>
</bpmn:extensionElements>
</bpmn:serviceTask>
However, this limits me to key-value pairs, whereas my custom elements in Camunda 7 allowed for multiple parameters and more complex structures.
My questions are:
- Is it still possible to use custom extension elements in Camunda 8, and if so, how can I define them?
- Given that
zeebe-client-java
doesn’t providemodelBuilder
, how can I register or handle custom elements in Camunda 8?