use of org.camunda.bpm.model.bpmn.instance.ExtensionElements in project camunda-bpmn-model by camunda.
the class CompatabilityTest method modifyingElementWithActivitiNsKeepsIt.
@Test
public void modifyingElementWithActivitiNsKeepsIt() {
BpmnModelInstance modelInstance = Bpmn.readModelFromStream(CamundaExtensionsTest.class.getResourceAsStream("CamundaExtensionsCompatabilityTest.xml"));
ProcessImpl process = modelInstance.getModelElementById(PROCESS_ID);
ExtensionElements extensionElements = process.getExtensionElements();
Collection<CamundaExecutionListener> listeners = extensionElements.getChildElementsByType(CamundaExecutionListener.class);
String listenerClass = "org.foo.Bar";
for (CamundaExecutionListener listener : listeners) {
listener.setCamundaClass(listenerClass);
}
for (CamundaExecutionListener listener : listeners) {
assertThat(listener.getAttributeValueNs(BpmnModelConstants.ACTIVITI_NS, "class"), is(listenerClass));
}
}
use of org.camunda.bpm.model.bpmn.instance.ExtensionElements in project camunda-bpmn-model by camunda.
the class ExtensionElementsImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ExtensionElements.class, BPMN_ELEMENT_EXTENSION_ELEMENTS).namespaceUri(BPMN20_NS).instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider<ExtensionElements>() {
public ExtensionElements newInstance(ModelTypeInstanceContext instanceContext) {
return new ExtensionElementsImpl(instanceContext);
}
});
typeBuilder.build();
}
Aggregations