Search in sources :

Example 1 with ProcessImpl

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()));
}
Also used : ProcessImpl(org.camunda.bpm.model.bpmn.impl.instance.ProcessImpl) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance) CamundaExtensionsTest(org.camunda.bpm.model.bpmn.CamundaExtensionsTest) CamundaExtensionsTest(org.camunda.bpm.model.bpmn.CamundaExtensionsTest) Test(org.junit.Test)

Example 2 with ProcessImpl

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));
    }
}
Also used : ExtensionElements(org.camunda.bpm.model.bpmn.instance.ExtensionElements) ProcessImpl(org.camunda.bpm.model.bpmn.impl.instance.ProcessImpl) BpmnModelInstance(org.camunda.bpm.model.bpmn.BpmnModelInstance) CamundaExtensionsTest(org.camunda.bpm.model.bpmn.CamundaExtensionsTest) CamundaExtensionsTest(org.camunda.bpm.model.bpmn.CamundaExtensionsTest) Test(org.junit.Test)

Aggregations

BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)2 CamundaExtensionsTest (org.camunda.bpm.model.bpmn.CamundaExtensionsTest)2 ProcessImpl (org.camunda.bpm.model.bpmn.impl.instance.ProcessImpl)2 Test (org.junit.Test)2 ExtensionElements (org.camunda.bpm.model.bpmn.instance.ExtensionElements)1