09-20-2011 02:18 AM
09-20-2011 03:16 AM
09-20-2011 03:30 AM
09-20-2011 03:34 AM
03-30-2016 04:48 PM
09-20-2011 04:03 AM
<process id="callingProcess" name="Process with call activity">
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="startIgnition" />
<manualTask id="startIgnition" name="Start ignition manutally" />
<sequenceFlow id="flow2" sourceRef="startIgnition"
targetRef="subProcess" />
<callActivity id="subProcess" name="Check ignition status"
calledElement="externalSubProcess" />
<sequenceFlow id="flow3" sourceRef="subProcess"
targetRef="measureVoltageTask" />
<userTask id="measureVoltageTask" name="Measure voltage" />
<sequenceFlow id="flow4" sourceRef="measureVoltageTask"
targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
Subprocess(in file: Example_Spec_02_sub_process.bpmn20.xml): <process id="externalSubProcess">
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart"
targetRef="verifyIgnitionOn" />
<userTask id="verifyIgnitionOn" name="Verify ignition on." />
<sequenceFlow id="flow2" sourceRef="verifyIgnitionOn"
targetRef="confirmIgnitionOn" />
<exclusiveGateway id="confirmIgnitionOn" />
<sequenceFlow id="flow3" sourceRef="confirmIgnitionOn"
targetRef="feedbackTask">
<conditionExpression><![CDATA[${!ignitionOn}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" sourceRef="confirmIgnitionOn"
targetRef="normalEnd">
<conditionExpression><![CDATA[${ignitionOn}]]></conditionExpression>
</sequenceFlow>
<userTask id="feedbackTask" name="Ignition not activated." />
<sequenceFlow id="flow5" sourceRef="feedbackTask"
targetRef="endEvent" />
<endEvent id="endEvent" />
<endEvent id="normalEnd" />
</process>
@Deployment(resources = {
"com/bigfirm/wfe/test/res/Example_Spec_02_calling_process.bpmn20.xml",
"com/bigfirm/wfe/test/res/Example_Spec_02_sub_process.bpmn20.xml" })
public void testSpec02SubProcess() throws Exception {
// After the process has started, the 'Start ignition' task
// should be active
ProcessInstance pi = runtimeService
.startProcessInstanceByKey("callingProcess");
TaskQuery taskQuery = taskService.createTaskQuery();
Task startIgnition = taskQuery.singleResult();
assertEquals("Verify ignition on.", startIgnition.getName());
// Verify with Query API
ProcessInstance subProcessInstance = runtimeService
.createProcessInstanceQuery()
.superProcessInstanceId(pi.getId()).singleResult();
assertNotNull(subProcessInstance);
assertEquals(pi.getId(), runtimeService.createProcessInstanceQuery()
.subProcessInstanceId(subProcessInstance.getId())
.singleResult().getId());
// Completing the task with approval, will end the subprocess and
// continue the original process arriving at the "Measure voltage task"
taskService.complete(startIgnition.getId(),
CollectionUtil.singletonMap("ignitionOn", true));
Task mesureVoltageTask = taskQuery.singleResult();
assertEquals("Measure voltage", mesureVoltageTask.getName());
}
09-20-2011 04:24 AM
06-06-2013 04:53 AM
06-10-2013 10:45 AM
10-31-2014 01:14 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.