use of org.camunda.bpm.model.bpmn.impl.instance.ProcessImpl in project camunda-bpmn-model by camunda.
the class CompatabilityTest method modifyingAttributeWithActivitiNsKeepsIt.
@Test
public void modifyingAttributeWithActivitiNsKeepsIt() {
BpmnModelInstance modelInstance = Bpmn.readModelFromStream(CamundaExtensionsTest.class.getResourceAsStream("CamundaExtensionsCompatabilityTest.xml"));
ProcessImpl process = modelInstance.getModelElementById(PROCESS_ID);
String priority = "9000";
process.setCamundaJobPriority(priority);
process.setCamundaTaskPriority(priority);
Integer historyTimeToLive = 10;
process.setCamundaHistoryTimeToLive(historyTimeToLive);
assertThat(process.getAttributeValueNs(BpmnModelConstants.ACTIVITI_NS, "jobPriority"), is(priority));
assertThat(process.getAttributeValueNs(BpmnModelConstants.ACTIVITI_NS, "taskPriority"), is(priority));
assertThat(process.getAttributeValueNs(BpmnModelConstants.ACTIVITI_NS, "historyTimeToLive"), is(historyTimeToLive.toString()));
}
use of org.camunda.bpm.model.bpmn.impl.instance.ProcessImpl 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));
}
}
Aggregations