03-08-2014 12:15 PM
<?xml version="1.0" encoding="UTF-8"?>
<definitions>
<message id="newRequest" name="newRequest"></message>
<process id="myProcess" name="My process" isExecutable="true">
<startEvent id="messagestartevent1" name="workflow">
<messageEventDefinition messageRef="newRequest"></messageEventDefinition>
</startEvent>
<userTask id="Approval" name="Approval">
<extensionElements>
<activiti:taskListener event="create" class="AssignSupervisor"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow1" sourceRef="messagestartevent1" targetRef="Approval"></sequenceFlow>
<endEvent id="endevent1" name="End">
<extensionElements>
<activiti:executionListener event="start" class="sendNotification"></activiti:executionListener>
</extensionElements>
</endEvent>
<sequenceFlow id="flow2" sourceRef="Approval" targetRef="endevent1"></sequenceFlow>
</process>
</definitions>
ProcessInstance costInstance = runtimeService.startProcessInstanceByMessage("newRequest");
TaskService ts = processEngine.getTaskService();
List<Task> tasks = ts.createTaskQuery().taskAssignee("supervisor1").list();
assertEquals(1, tasks.size()); //true
ts.complete(tasks.get(0).getId());
System.out.println(costInstance.getActivityId()); //Approval
assertEquals(true, costInstance.isEnded()); //false
03-09-2014 10:56 PM
03-10-2014 02:11 AM
03-10-2014 02:15 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.