Extension properties

Hi Sorin,

you can use the Model API to get the extension elements.

public class ExampleExecutionListener implements ExecutionListener {

  public void notify(DelegateExecution execution) throws Exception {
    StartEvent startEvent = (StartEvent) execution.getBpmnModelElementInstance();

    ExtensionElements extensionElements = startEvent.getExtensionElements();
    Collection<CamundaProperty> properties = extensionElements .getElementsQuery()
      .filterByType(CamundaProperties.class)
      .singleResult()
      .getCamundaProperties();

    for (CamundaProperty property : properties) {
      String name = property.getCamundaName();
      String value = property.getCamundaValue();

     // ...
    }
  }
}

See (1) and (2).

Greetings,
Philipp

2 Likes