I'm following this tutorial (https://github.com/camunda/camunda-bpm-examples/tree/master/cmmn-model-api/typed-custom-elements) and I'm trying to transfer it to be usable in BPMN.
In the bpmn file I created this task:
[...]
<bpmn2:task id="Task" name="Task">
<bpmn2:extensionElements>
<foo:bar id="someID"/>
</bpmn2:extensionElements>
</bpmn2:task>
[...]
The namespace was declared in the root element:
xmlns:foo="http://www.someURI.com"
Registering my new Type is no problem. But I don't know how to access it in the parse listener. The getExtensionElements-function (see: https://github.com/camunda/camunda-bpm-examples/blob/master/cmmn-model-api/typed-custom-elements/src/main/java/org/camunda/bpm/example/modelapi/KPITransformListener.java) is not available in the parseTask function (see https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/AbstractBpmnParseListener.java).
How do i access the extension elements?
In the CMMN example the humanTask is giving you this functionality (https://github.com/camunda/camunda-bpm-examples/blob/master/cmmn-model-api/typed-custom-elements/src/main/java/org/camunda/bpm/example/modelapi/KPITransformListener.java).
Cheers.
public void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) {
BpmnModelInstance bpmnModelInstance = repositoryService.getBpmnModelInstance(activity.getProcessDefinition().getId()); UserTask userTask = bpmnModelInstance.getModelElementById(activity.getActivityId()); // ... }