Reading Extensions

Hey guys,

sorry for my second post in these similar topic, but I think it makes sense to open a new one.
I have added extensions to the tasks and now want to read them out again. Is there a proposed way for this?
I could not find any thing in the normal documentation and I’m not very familiar with the java doc file :confused:

Below is my code so far. So think I can access the properties via DOMelement, childs and attributes etc.

But is there a more convenient way?

ModelInstance camundaInstance = currentInstance.getModelInstance();

Iterator<CamundaProperty> iterator = camundaInstance.getModelElementsByType(CamundaProperty.class) .iterator();
    
  while (iterator.hasNext()) {
    
       ModelInstance extensionInstance = iterator.next().getModelInstance();
    				
       // Here must be the access
    				
 }

Thanks John

Hi @JohnSmith,

There is an example project that shows how to do a similar thing with CMMN XML: https://github.com/camunda/camunda-bpm-examples/tree/master/cmmn-model-api/typed-custom-elements

While this uses the cmmn model api, the principles apply to the bpmn model api in a similar way.

Cheers,
Thorben