Is Custom ExtensionElements available in camunda 8 ?

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 provide modelBuilder, how can I register or handle custom elements in Camunda 8?

camunda-bpm-examples/cmmn-model-api/typed-custom-elements at 7.18 · camunda/camunda-bpm-examples · GitHub Custom elements created in camunda 7 are somewhat similar to this example but for BPMN.

Any idea about this @Zelldon @Niall @korthout @hassang

Can you explain a bit about why your need these extension elements and what they’re for?

@Niall - The custom extension allow me to define more complex and structured metadata for tasks.

Use Case:
In Camunda 7, I add configuration data to service task (extension element) and then while that service task executes I use extended custom element data in java Delegates for a service Task.

These custom elements allow me to:

  1. Model tasks with greater flexibility by defining nested structures and custom attributes, which key-value pairs don’t adequately capture.
  2. Ensure extensibility by allowing the model to evolve with business requirements, without needing to hardcode logic into the process definition.

Additionally
If you want to know how do I use this in camunda 7 here is example

I have structure of my custom class I registered it to engine using modelBuilder and than fetch it in java delegates (As we can see in url i mentioned in above reply : Is Custom ExtensionElements available in camunda 8 ? - #2 by vishu899)

Problem is that there is no concept of java delegate in camunda8 all we have is worker, and if we want any custom BPMN Element from running process instance it is through only job or job client and We can’t fetch modelinstance from job variable. neither there is way to register my custom element to engine in camunda8