@Test public void testSetLocalScopeWithExecutionListenerTake() { BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("process") .startEvent().id("activityId") .sequenceFlowId("sequenceFlow") .endEvent() .done(); CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class); listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE); listener.setCamundaClass(ExecutionListener.class.getName()); modelInstance.<SequenceFlow>getModelElementById("sequenceFlow").builder().addExtensionElement(listener); testHelper.deploy(modelInstance); engineRule.getRuntimeService().startProcessInstanceByKey("process"); }
private void deployAndStartTestProcess(String elementId, String eventName) { BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent(START_ID) .sequenceFlowId(SEQUENCE_FLOW_ID) .intermediateCatchEvent(CATCH_EVENT_ID) .parallelGateway(GATEWAY_ID) .userTask(USER_TASK_ID) .endEvent(END_ID) .done(); addMessageEventDefinition((CatchEvent) modelInstance.getModelElementById(CATCH_EVENT_ID)); addExecutionListener((BaseElement) modelInstance.getModelElementById(elementId), eventName); deployAndStartProcess(modelInstance); }
@Test public void testSetLocalScopeWithExecutionListenerTake() { BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("process") .startEvent().id("activityId") .sequenceFlowId("sequenceFlow") .endEvent() .done(); CamundaExecutionListener listener = modelInstance.newInstance(CamundaExecutionListener.class); listener.setCamundaEvent(ExecutionListener.EVENTNAME_TAKE); listener.setCamundaClass(ExecutionListener.class.getName()); modelInstance.<SequenceFlow>getModelElementById("sequenceFlow").builder().addExtensionElement(listener); testHelper.deploy(modelInstance); engineRule.getRuntimeService().startProcessInstanceByKey("process"); }
private void deployAndStartTestProcess(String elementId, String eventName) { BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID) .startEvent(START_ID) .sequenceFlowId(SEQUENCE_FLOW_ID) .intermediateCatchEvent(CATCH_EVENT_ID) .parallelGateway(GATEWAY_ID) .userTask(USER_TASK_ID) .endEvent(END_ID) .done(); addMessageEventDefinition((CatchEvent) modelInstance.getModelElementById(CATCH_EVENT_ID)); addExecutionListener((BaseElement) modelInstance.getModelElementById(elementId), eventName); deployAndStartProcess(modelInstance); }