As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<process id="callingProcess" name="Process with call activity"><br> <startEvent id="theStart" /><br> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="startIgnition" /><br> <manualTask id="startIgnition" name="Start ignition manutally" /><br> <sequenceFlow id="flow2" sourceRef="startIgnition"<br> targetRef="subProcess" /><br> <callActivity id="subProcess" name="Check ignition status"<br> calledElement="externalSubProcess" /><br> <sequenceFlow id="flow3" sourceRef="subProcess"<br> targetRef="measureVoltageTask" /><br> <userTask id="measureVoltageTask" name="Measure voltage" /><br> <sequenceFlow id="flow4" sourceRef="measureVoltageTask"<br> targetRef="theEnd" /><br> <endEvent id="theEnd" /><br> </process><br>
<process id="externalSubProcess"><br><br> <startEvent id="theStart" /><br> <sequenceFlow id="flow1" sourceRef="theStart"<br> targetRef="verifyIgnitionOn" /><br><br> <userTask id="verifyIgnitionOn" name="Verify ignition on." /><br> <sequenceFlow id="flow2" sourceRef="verifyIgnitionOn"<br> targetRef="confirmIgnitionOn" /><br><br> <exclusiveGateway id="confirmIgnitionOn" /><br> <sequenceFlow id="flow3" sourceRef="confirmIgnitionOn"<br> targetRef="feedbackTask"><br> <conditionExpression><![CDATA[${!ignitionOn}]]></conditionExpression><br> </sequenceFlow><br> <sequenceFlow id="flow4" sourceRef="confirmIgnitionOn"<br> targetRef="normalEnd"><br> <conditionExpression><![CDATA[${ignitionOn}]]></conditionExpression><br> </sequenceFlow><br><br> <userTask id="feedbackTask" name="Ignition not activated." /><br> <sequenceFlow id="flow5" sourceRef="feedbackTask"<br> targetRef="endEvent" /><br> <endEvent id="endEvent" /><br><br> <endEvent id="normalEnd" /><br><br> </process><br>
@Deployment(resources = {<br> "com/bigfirm/wfe/test/res/Example_Spec_02_calling_process.bpmn20.xml",<br> "com/bigfirm/wfe/test/res/Example_Spec_02_sub_process.bpmn20.xml" })<br> public void testSpec02SubProcess() throws Exception {<br> // After the process has started, the 'Start ignition' task<br> // should be active<br> ProcessInstance pi = runtimeService<br> .startProcessInstanceByKey("callingProcess");<br> TaskQuery taskQuery = taskService.createTaskQuery();<br> Task startIgnition = taskQuery.singleResult();<br> assertEquals("Verify ignition on.", startIgnition.getName());<br><br> // Verify with Query API<br> ProcessInstance subProcessInstance = runtimeService<br> .createProcessInstanceQuery()<br> .superProcessInstanceId(pi.getId()).singleResult();<br> assertNotNull(subProcessInstance);<br> assertEquals(pi.getId(), runtimeService.createProcessInstanceQuery()<br> .subProcessInstanceId(subProcessInstance.getId())<br> .singleResult().getId());<br><br> // Completing the task with approval, will end the subprocess and<br> // continue the original process arriving at the "Measure voltage task"<br> taskService.complete(startIgnition.getId(),<br> CollectionUtil.singletonMap("ignitionOn", true));<br> Task mesureVoltageTask = taskQuery.singleResult();<br> assertEquals("Measure voltage", mesureVoltageTask.getName());<br> }<br>