Commit 9bbab747 authored by cijujoseph's avatar cijujoseph

Added more unit test examples and use cases

parent 72015c13
package com.alfresco.aps.example.listeners;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;
@Component("processEndExecutionListener")
public class ProcessEndExecutionListener implements ExecutionListener {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void notify(DelegateExecution execution) throws Exception {
// TODO Auto-generated method stub
System.out.println(execution.getId());
}
}
package com.alfresco.aps.example.listeners;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Component;
@Component("taskAssignedTaskListener")
public class TaskAssignedTaskListener implements TaskListener {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void notify(DelegateTask task) {
System.out.println(task.getId());
}
}
package com.alfresco.aps.example.listeners;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.springframework.stereotype.Component;
@Component("timerFiredEventListener")
public class TimerFiredEventListener implements ActivitiEventListener{
@Override
public boolean isFailOnException() {
// TODO Auto-generated method stub
return false;
}
@Override
public void onEvent(ActivitiEvent event) {
// TODO Auto-generated method stub
System.out.println(event.getExecutionId());
}
}
{"name":"Test App","description":"","definition":{"models":[{"id":60061,"name":"EmailTaskProcess","version":2,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-29T16:27:58.511+0000"},{"id":60060,"name":"ReceiveTaskProcess","version":2,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.102+0000"},{"id":59068,"name":"MessageCatch","version":2,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.119+0000"},{"id":59063,"name":"UserAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.146+0000"},{"id":59061,"name":"CandidateUserGroupFixedAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.164+0000"},{"id":59059,"name":"CandidateGroupAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.183+0000"},{"id":59060,"name":"CandidateUserAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.202+0000"},{"id":58058,"name":"NoOpProcess","version":7,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.220+0000"},{"id":58060,"name":"APSRestStepProcess","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.235+0000"},{"id":59064,"name":"IntermediateTimerCatchProcess","version":3,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.251+0000"},{"id":59065,"name":"BoundaryTimerCatchProcess","version":3,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.274+0000"},{"id":58059,"name":"UserTaskProcess","version":6,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.302+0000"},{"id":59066,"name":"SignalCatch","version":3,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.320+0000"}],"theme":"theme-1","icon":"glyphicon-asterisk","publishIdentityInfo":[]}}
\ No newline at end of file
{"name":"Test App","description":"","definition":{"models":[{"id":61074,"name":"GatewaysAndConditions","version":1,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-10-02T20:23:08.394+0000"},{"id":61073,"name":"CustomListeners","version":1,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-10-02T19:59:17.046+0000"},{"id":60061,"name":"EmailTaskProcess","version":2,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-29T16:27:58.511+0000"},{"id":59066,"name":"SignalCatch","version":3,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.320+0000"},{"id":58059,"name":"UserTaskProcess","version":6,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.302+0000"},{"id":59065,"name":"BoundaryTimerCatchProcess","version":3,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.274+0000"},{"id":59064,"name":"IntermediateTimerCatchProcess","version":3,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.251+0000"},{"id":58060,"name":"APSRestStepProcess","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.235+0000"},{"id":58058,"name":"NoOpProcess","version":7,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.220+0000"},{"id":59060,"name":"CandidateUserAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.202+0000"},{"id":59059,"name":"CandidateGroupAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.183+0000"},{"id":59061,"name":"CandidateUserGroupFixedAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.164+0000"},{"id":59063,"name":"UserAssignment","version":4,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.146+0000"},{"id":59068,"name":"MessageCatch","version":2,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.119+0000"},{"id":60060,"name":"ReceiveTaskProcess","version":2,"modelType":0,"description":"","stencilSetId":0,"createdByFullName":"Ciju Administrator","createdBy":1,"lastUpdatedByFullName":"Ciju Administrator","lastUpdatedBy":1,"lastUpdated":"2017-09-27T19:27:02.102+0000"}],"theme":"theme-1","icon":"glyphicon-asterisk","publishIdentityInfo":[]}}
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343249" modeler:modelId="58060" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422235" modeler:originalModelId="58059" modeler:originalModelVersion="3">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813890" modeler:modelId="58060" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422235" modeler:originalModelId="58059" modeler:originalModelVersion="3">
<process id="APSRestStepProcess" name="APSRestStepProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343257" modeler:modelId="59065" modeler:modelVersion="3" modeler:modelLastUpdated="1506540422274" modeler:originalModelId="59064" modeler:originalModelVersion="1">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813883" modeler:modelId="59065" modeler:modelVersion="3" modeler:modelLastUpdated="1506540422274" modeler:originalModelId="59064" modeler:originalModelVersion="1">
<process id="BoundaryTimerCatchProcess" name="BoundaryTimerCatchProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343237" modeler:modelId="59059" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422183">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813902" modeler:modelId="59059" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422183">
<process id="CandidateGroupAssignment" name="Candidate Group Assignment" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343241" modeler:modelId="59060" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422202" modeler:originalModelId="59059" modeler:originalModelVersion="1">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813896" modeler:modelId="59060" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422202" modeler:originalModelId="59059" modeler:originalModelVersion="1">
<process id="CandidateUserAssignment" name="CandidateUserAssignment" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343233" modeler:modelId="59061" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422164" modeler:originalModelId="59060" modeler:originalModelVersion="1">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813906" modeler:modelId="59061" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422164" modeler:originalModelId="59060" modeler:originalModelVersion="1">
<process id="CandidateUserGroupFixedAssignment" name="CandidateUserGroupFixedAssignment" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813868" modeler:modelId="61073" modeler:modelVersion="1" modeler:modelLastUpdated="1506974357046">
<process id="CustomListeners" name="CustomListeners" isExecutable="true">
<extensionElements>
<activiti:eventListener events="TIMER_FIRED" delegateExpression="${timerFiredEventListener}"/>
</extensionElements>
<startEvent id="startEvent1" name="Start">
<extensionElements>
<modeler:editor-resource-id><![CDATA[startEvent1]]></modeler:editor-resource-id>
</extensionElements>
</startEvent>
<userTask id="sid-58447047-B350-4E06-A2A7-15533F6CB022" name="User TasK" activiti:assignee="$INITIATOR">
<extensionElements>
<activiti:taskListener event="assignment" delegateExpression="${taskAssignedTaskListener}"/>
<modeler:allow-send-email><![CDATA[true]]></modeler:allow-send-email>
<modeler:activiti-idm-initiator><![CDATA[true]]></modeler:activiti-idm-initiator>
<modeler:editor-resource-id><![CDATA[sid-58447047-B350-4E06-A2A7-15533F6CB022]]></modeler:editor-resource-id>
</extensionElements>
</userTask>
<sequenceFlow id="sid-282614CD-A99E-4721-A033-61845A32F92F" sourceRef="startEvent1" targetRef="sid-58447047-B350-4E06-A2A7-15533F6CB022">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-282614CD-A99E-4721-A033-61845A32F92F]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<endEvent id="sid-72B70FDF-D205-4094-AECD-73B126AD41FA" name="End">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="${processEndExecutionListener}"/>
<modeler:editor-resource-id><![CDATA[sid-72B70FDF-D205-4094-AECD-73B126AD41FA]]></modeler:editor-resource-id>
</extensionElements>
</endEvent>
<intermediateCatchEvent id="sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F" name="Wait">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F]]></modeler:editor-resource-id>
</extensionElements>
<timerEventDefinition>
<timeDuration>PT2M</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<sequenceFlow id="sid-72D28DF7-9312-4C13-9F95-63CB1C500B59" sourceRef="sid-58447047-B350-4E06-A2A7-15533F6CB022" targetRef="sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-72D28DF7-9312-4C13-9F95-63CB1C500B59]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<sequenceFlow id="sid-5722B70F-A09C-49A0-BCF8-6382BB62506B" sourceRef="sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F" targetRef="sid-72B70FDF-D205-4094-AECD-73B126AD41FA">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-5722B70F-A09C-49A0-BCF8-6382BB62506B]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_CustomListeners">
<bpmndi:BPMNPlane bpmnElement="CustomListeners" id="BPMNPlane_CustomListeners">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="90.0" y="150.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-58447047-B350-4E06-A2A7-15533F6CB022" id="BPMNShape_sid-58447047-B350-4E06-A2A7-15533F6CB022">
<omgdc:Bounds height="80.0" width="100.0" x="180.0" y="125.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-72B70FDF-D205-4094-AECD-73B126AD41FA" id="BPMNShape_sid-72B70FDF-D205-4094-AECD-73B126AD41FA">
<omgdc:Bounds height="28.0" width="28.0" x="435.0" y="151.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F" id="BPMNShape_sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F">
<omgdc:Bounds height="31.0" width="31.0" x="330.0" y="149.5"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-5722B70F-A09C-49A0-BCF8-6382BB62506B" id="BPMNEdge_sid-5722B70F-A09C-49A0-BCF8-6382BB62506B">
<omgdi:waypoint x="361.9998114841499" y="165.42233101221285"/>
<omgdi:waypoint x="435.0001649513688" y="165.06796036431376"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-282614CD-A99E-4721-A033-61845A32F92F" id="BPMNEdge_sid-282614CD-A99E-4721-A033-61845A32F92F">
<omgdi:waypoint x="120.0" y="165.0"/>
<omgdi:waypoint x="180.0" y="165.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-72D28DF7-9312-4C13-9F95-63CB1C500B59" id="BPMNEdge_sid-72D28DF7-9312-4C13-9F95-63CB1C500B59">
<omgdi:waypoint x="280.0" y="165.2155172413793"/>
<omgdi:waypoint x="330.0001486305092" y="165.43103512340738"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
{"resourceId":61073,"properties":{"process_id":"CustomListeners","name":"CustomListeners","documentation":"","process_author":"","process_version":"","process_namespace":"http://www.activiti.org/processdef","executionlisteners":"","eventlisteners":"{\"eventListeners\":[{\"event\":\"TIMER_FIRED\",\"implementation\":\"${timerFiredEventListener}\",\"className\":\"\",\"delegateExpression\":\"${timerFiredEventListener}\",\"retrowEvent\":false,\"fields\":[],\"events\":[{\"event\":\"TIMER_FIRED\",\"$$hashKey\":\"object:4322\"}],\"$$hashKey\":\"uiGrid-003F\"}]}","signaldefinitions":"","messagedefinitions":"","executionvariables":"","metadata":""},"stencil":{"id":"BPMNDiagram"},"childShapes":[{"resourceId":"startEvent1","properties":{"overrideid":"","name":"Start","documentation":"","executionlisteners":"","initiator":"","formkeydefinition":"","formreference":"","fieldstovariables":"","formproperties":""},"stencil":{"id":"StartNoneEvent"},"childShapes":[],"outgoing":[{"resourceId":"sid-282614CD-A99E-4721-A033-61845A32F92F"}],"bounds":{"lowerRight":{"x":120,"y":180},"upperLeft":{"x":90,"y":150}},"dockers":[]},{"resourceId":"sid-58447047-B350-4E06-A2A7-15533F6CB022","properties":{"overrideid":"","name":"User TasK","documentation":"","asynchronousdefinition":"false","exclusivedefinition":"false","executionlisteners":"","multiinstance_type":"None","multiinstance_cardinality":"","multiinstance_collection":"","multiinstance_variable":"","multiinstance_condition":"","isforcompensation":"false","usertasksendemail":true,"usertaskassignment":"","formkeydefinition":"","formreference":"","fieldstovariables":"","duedatedefinition":"","prioritydefinition":"","categorydefinition":"","formproperties":"","tasklisteners":{"taskListeners":[{"event":"assignment","implementation":"${taskAssignedTaskListener}","className":"","expression":"","delegateExpression":"${taskAssignedTaskListener}","$$hashKey":"uiGrid-004P","fields":[]}]},"emailtemplate":""},"stencil":{"id":"UserTask"},"childShapes":[],"outgoing":[{"resourceId":"sid-72D28DF7-9312-4C13-9F95-63CB1C500B59"}],"bounds":{"lowerRight":{"x":280,"y":205},"upperLeft":{"x":180,"y":125}},"dockers":[]},{"resourceId":"sid-282614CD-A99E-4721-A033-61845A32F92F","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-58447047-B350-4E06-A2A7-15533F6CB022"}],"bounds":{"lowerRight":{"x":179.1953125,"y":165},"upperLeft":{"x":120.6484375,"y":165}},"dockers":[{"x":15,"y":15},{"x":50,"y":40}],"target":{"resourceId":"sid-58447047-B350-4E06-A2A7-15533F6CB022"}},{"resourceId":"sid-72B70FDF-D205-4094-AECD-73B126AD41FA","properties":{"overrideid":"","name":"End","documentation":"","executionlisteners":{"executionListeners":[{"event":"start","implementation":"${processEndExecutionListener}","className":"","expression":"","delegateExpression":"${processEndExecutionListener}","$$hashKey":"uiGrid-0033","fields":[]}]}},"stencil":{"id":"EndNoneEvent"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":463,"y":179},"upperLeft":{"x":435,"y":151}},"dockers":[]},{"resourceId":"sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F","properties":{"overrideid":"","name":"Wait","documentation":"","executionlisteners":"","timercycledefinition":"","timerdatedefinition":"","timerdurationdefinition":"PT2M"},"stencil":{"id":"CatchTimerEvent"},"childShapes":[],"outgoing":[{"resourceId":"sid-5722B70F-A09C-49A0-BCF8-6382BB62506B"}],"bounds":{"lowerRight":{"x":361,"y":180.5},"upperLeft":{"x":330,"y":149.5}},"dockers":[{"x":345.5,"y":165}]},{"resourceId":"sid-72D28DF7-9312-4C13-9F95-63CB1C500B59","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F"}],"bounds":{"lowerRight":{"x":330.5000092894068,"y":165.43318969521297},"upperLeft":{"x":280.8437407105932,"y":165.21915405478703}},"dockers":[{"x":50,"y":40},{"x":16,"y":16}],"target":{"resourceId":"sid-F04126DA-8067-492A-9BB5-DB9D3F9E112F"}},{"resourceId":"sid-5722B70F-A09C-49A0-BCF8-6382BB62506B","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-72B70FDF-D205-4094-AECD-73B126AD41FA"}],"bounds":{"lowerRight":{"x":434.3203242822406,"y":165.4248331882633},"upperLeft":{"x":361.4843632177594,"y":165.0712605617367}},"dockers":[{"x":16,"y":16},{"x":14,"y":14}],"target":{"resourceId":"sid-72B70FDF-D205-4094-AECD-73B126AD41FA"}}],"bounds":{"lowerRight":{"x":1200,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"stencilsets/bpmn2.0/bpmn2.0.json","namespace":"http://b3mn.org/stencilset/bpmn2.0#"},"ssextensions":[]}
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343219" modeler:modelId="60061" modeler:modelVersion="2" modeler:modelLastUpdated="1506702478511" modeler:originalModelId="60060" modeler:originalModelVersion="1">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813872" modeler:modelId="60061" modeler:modelVersion="2" modeler:modelLastUpdated="1506702478511" modeler:originalModelId="60060" modeler:originalModelVersion="1">
<process id="EmailTaskProcess" name="EmailTaskProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813862" modeler:modelId="61074" modeler:modelVersion="1" modeler:modelLastUpdated="1506975788394">
<process id="GatewaysAndConditions" name="GatewaysAndConditions" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
<modeler:editor-resource-id><![CDATA[startEvent1]]></modeler:editor-resource-id>
</extensionElements>
</startEvent>
<userTask id="user-task" name="user-task" activiti:assignee="$INITIATOR" activiti:formKey="61075">
<extensionElements>
<modeler:allow-send-email><![CDATA[true]]></modeler:allow-send-email>
<modeler:form-reference-id><![CDATA[61075]]></modeler:form-reference-id>
<modeler:form-reference-name><![CDATA[user-task-form]]></modeler:form-reference-name>
<modeler:activiti-idm-initiator><![CDATA[true]]></modeler:activiti-idm-initiator>
<modeler:editor-resource-id><![CDATA[sid-0AD3F9D5-E9A1-400D-A47D-4F6805B24D92]]></modeler:editor-resource-id>
</extensionElements>
</userTask>
<sequenceFlow id="sid-AF7D69E4-653F-47C3-BE0C-ADE406059D16" sourceRef="startEvent1" targetRef="user-task">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-AF7D69E4-653F-47C3-BE0C-ADE406059D16]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<exclusiveGateway id="sid-662517F1-3905-4275-AA57-4F121648D972" default="sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-662517F1-3905-4275-AA57-4F121648D972]]></modeler:editor-resource-id>
</extensionElements>
</exclusiveGateway>
<sequenceFlow id="sid-6FAD713E-88E4-407F-92AE-C23B0D18EF34" sourceRef="user-task" targetRef="sid-662517F1-3905-4275-AA57-4F121648D972">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-6FAD713E-88E4-407F-92AE-C23B0D18EF34]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<userTask id="sid-1423F916-2174-4CA4-9EA8-C455170B5464" name="rejected" activiti:assignee="$INITIATOR">
<extensionElements>
<modeler:allow-send-email><![CDATA[true]]></modeler:allow-send-email>
<modeler:activiti-idm-initiator><![CDATA[true]]></modeler:activiti-idm-initiator>
<modeler:editor-resource-id><![CDATA[sid-1423F916-2174-4CA4-9EA8-C455170B5464]]></modeler:editor-resource-id>
</extensionElements>
</userTask>
<sequenceFlow id="sid-F3E3D230-54ED-4B5D-A11B-5D01A6328F6E" name="Reject" sourceRef="sid-662517F1-3905-4275-AA57-4F121648D972" targetRef="sid-1423F916-2174-4CA4-9EA8-C455170B5464">
<extensionElements>
<modeler:conditionDefinition modeler:index="0" modeler:outcomeFormId="61075" modeler:outcomeFormName="user-task-form" modeler:rightOutcomeName="Reject" modeler:operator="=="/>
<modeler:editor-resource-id><![CDATA[sid-F3E3D230-54ED-4B5D-A11B-5D01A6328F6E]]></modeler:editor-resource-id>
</extensionElements>
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${(activiti_flowConditionsBean.exists(execution, 'form61075outcome') && form61075outcome == 'Reject')}]]></conditionExpression>
</sequenceFlow>
<endEvent id="sid-67831254-5263-4F5D-87D2-27153F20E647" name="approved">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-67831254-5263-4F5D-87D2-27153F20E647]]></modeler:editor-resource-id>
</extensionElements>
</endEvent>
<endEvent id="sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C" name="rejected">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C]]></modeler:editor-resource-id>
</extensionElements>
</endEvent>
<sequenceFlow id="sid-E566A795-7E56-4722-BB28-AC34BAD6BC7C" sourceRef="sid-1423F916-2174-4CA4-9EA8-C455170B5464" targetRef="sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-E566A795-7E56-4722-BB28-AC34BAD6BC7C]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<sequenceFlow id="sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98" sourceRef="sid-662517F1-3905-4275-AA57-4F121648D972" targetRef="sid-67831254-5263-4F5D-87D2-27153F20E647">
<extensionElements>
<modeler:editor-resource-id><![CDATA[sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_GatewaysAndConditions">
<bpmndi:BPMNPlane bpmnElement="GatewaysAndConditions" id="BPMNPlane_GatewaysAndConditions">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="90.0" y="150.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="user-task" id="BPMNShape_user-task">
<omgdc:Bounds height="80.0" width="100.0" x="195.0" y="125.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-662517F1-3905-4275-AA57-4F121648D972" id="BPMNShape_sid-662517F1-3905-4275-AA57-4F121648D972">
<omgdc:Bounds height="40.0" width="40.0" x="340.0" y="145.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-1423F916-2174-4CA4-9EA8-C455170B5464" id="BPMNShape_sid-1423F916-2174-4CA4-9EA8-C455170B5464">
<omgdc:Bounds height="80.0" width="100.0" x="425.0" y="15.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-67831254-5263-4F5D-87D2-27153F20E647" id="BPMNShape_sid-67831254-5263-4F5D-87D2-27153F20E647">
<omgdc:Bounds height="28.0" width="28.0" x="570.0" y="151.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C" id="BPMNShape_sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C">
<omgdc:Bounds height="28.0" width="28.0" x="570.0" y="41.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-E566A795-7E56-4722-BB28-AC34BAD6BC7C" id="BPMNEdge_sid-E566A795-7E56-4722-BB28-AC34BAD6BC7C">
<omgdi:waypoint x="525.0" y="55.0"/>
<omgdi:waypoint x="570.0" y="55.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98" id="BPMNEdge_sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98">
<omgdi:waypoint x="379.54260089686096" y="165.457399103139"/>
<omgdi:waypoint x="570.0000350333255" y="165.0313198321402"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-F3E3D230-54ED-4B5D-A11B-5D01A6328F6E" id="BPMNEdge_sid-F3E3D230-54ED-4B5D-A11B-5D01A6328F6E">
<omgdi:waypoint x="360.5" y="145.5"/>
<omgdi:waypoint x="360.5" y="55.0"/>
<omgdi:waypoint x="425.0" y="55.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-AF7D69E4-653F-47C3-BE0C-ADE406059D16" id="BPMNEdge_sid-AF7D69E4-653F-47C3-BE0C-ADE406059D16">
<omgdi:waypoint x="120.0" y="165.0"/>
<omgdi:waypoint x="195.0" y="165.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-6FAD713E-88E4-407F-92AE-C23B0D18EF34" id="BPMNEdge_sid-6FAD713E-88E4-407F-92AE-C23B0D18EF34">
<omgdi:waypoint x="295.0" y="165.2164502164502"/>
<omgdi:waypoint x="340.4130434782609" y="165.41304347826087"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
{"resourceId":61074,"properties":{"process_id":"GatewaysAndConditions","name":"GatewaysAndConditions","documentation":"","process_author":"","process_version":"","process_namespace":"http://www.activiti.org/processdef","executionlisteners":"","eventlisteners":"","signaldefinitions":"","messagedefinitions":"","executionvariables":"","metadata":""},"stencil":{"id":"BPMNDiagram"},"childShapes":[{"resourceId":"startEvent1","properties":{"overrideid":"","name":"","documentation":"","executionlisteners":"","initiator":"","formkeydefinition":"","formreference":null,"fieldstovariables":"","formproperties":""},"stencil":{"id":"StartNoneEvent"},"childShapes":[],"outgoing":[{"resourceId":"sid-AF7D69E4-653F-47C3-BE0C-ADE406059D16"}],"bounds":{"lowerRight":{"x":120,"y":180},"upperLeft":{"x":90,"y":150}},"dockers":[]},{"resourceId":"sid-0AD3F9D5-E9A1-400D-A47D-4F6805B24D92","properties":{"overrideid":"user-task","name":"user-task","documentation":"","asynchronousdefinition":"false","exclusivedefinition":"false","executionlisteners":"","multiinstance_type":"None","multiinstance_cardinality":"","multiinstance_collection":"","multiinstance_variable":"","multiinstance_condition":"","isforcompensation":"false","usertasksendemail":true,"usertaskassignment":"","formkeydefinition":"","formreference":{"id":61075,"name":"user-task-form","referenceId":61074},"fieldstovariables":"","duedatedefinition":"","prioritydefinition":"","categorydefinition":"","formproperties":"","tasklisteners":"","emailtemplate":""},"stencil":{"id":"UserTask"},"childShapes":[],"outgoing":[{"resourceId":"sid-6FAD713E-88E4-407F-92AE-C23B0D18EF34"}],"bounds":{"lowerRight":{"x":295,"y":205},"upperLeft":{"x":195,"y":125}},"dockers":[]},{"resourceId":"sid-AF7D69E4-653F-47C3-BE0C-ADE406059D16","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-0AD3F9D5-E9A1-400D-A47D-4F6805B24D92"}],"bounds":{"lowerRight":{"x":194.78125,"y":165},"upperLeft":{"x":120.21875,"y":165}},"dockers":[{"x":15,"y":15},{"x":50,"y":40}],"target":{"resourceId":"sid-0AD3F9D5-E9A1-400D-A47D-4F6805B24D92"}},{"resourceId":"sid-662517F1-3905-4275-AA57-4F121648D972","properties":{"overrideid":"","name":"","documentation":"","asynchronousdefinition":"false","exclusivedefinition":"false","sequencefloworder":""},"stencil":{"id":"ExclusiveGateway"},"childShapes":[],"outgoing":[{"resourceId":"sid-F3E3D230-54ED-4B5D-A11B-5D01A6328F6E"},{"resourceId":"sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98"}],"bounds":{"lowerRight":{"x":380,"y":185},"upperLeft":{"x":340,"y":145}},"dockers":[]},{"resourceId":"sid-6FAD713E-88E4-407F-92AE-C23B0D18EF34","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-662517F1-3905-4275-AA57-4F121648D972"}],"bounds":{"lowerRight":{"x":339.64844687000755,"y":165.4097335362338},"upperLeft":{"x":295.62889687999245,"y":165.2191727137662}},"dockers":[{"x":50,"y":40},{"x":20.5,"y":20.5}],"target":{"resourceId":"sid-662517F1-3905-4275-AA57-4F121648D972"}},{"resourceId":"sid-1423F916-2174-4CA4-9EA8-C455170B5464","properties":{"overrideid":"","name":"rejected","documentation":"","asynchronousdefinition":"false","exclusivedefinition":"false","executionlisteners":"","multiinstance_type":"None","multiinstance_cardinality":"","multiinstance_collection":"","multiinstance_variable":"","multiinstance_condition":"","isforcompensation":"false","usertasksendemail":true,"usertaskassignment":"","formkeydefinition":"","formreference":"","fieldstovariables":"","duedatedefinition":"","prioritydefinition":"","categorydefinition":"","formproperties":"","tasklisteners":"","emailtemplate":""},"stencil":{"id":"UserTask"},"childShapes":[],"outgoing":[{"resourceId":"sid-E566A795-7E56-4722-BB28-AC34BAD6BC7C"}],"bounds":{"lowerRight":{"x":525,"y":95},"upperLeft":{"x":425,"y":15}},"dockers":[]},{"resourceId":"sid-F3E3D230-54ED-4B5D-A11B-5D01A6328F6E","properties":{"overrideid":"","name":"Reject","documentation":"","conditionsequenceflow":{"expression":{"type":"variables","outcomeFormId":61075,"outcomeFormName":"user-task-form","operator":"==","rightOutcomeFormId":61075,"rightOutcomeFormName":"user-task-form","rightOutcomeName":"Reject"}},"executionlisteners":"","defaultflow":false},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-1423F916-2174-4CA4-9EA8-C455170B5464"}],"bounds":{"lowerRight":{"x":424.80078125,"y":144.64453125},"upperLeft":{"x":360.5,"y":55}},"dockers":[{"x":20.5,"y":20.5},{"x":360.5,"y":55},{"x":50,"y":40}],"target":{"resourceId":"sid-1423F916-2174-4CA4-9EA8-C455170B5464"}},{"resourceId":"sid-67831254-5263-4F5D-87D2-27153F20E647","properties":{"overrideid":"","name":"approved","documentation":"","executionlisteners":""},"stencil":{"id":"EndNoneEvent"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":598,"y":179},"upperLeft":{"x":570,"y":151}},"dockers":[]},{"resourceId":"sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C","properties":{"overrideid":"","name":"rejected","documentation":"","executionlisteners":""},"stencil":{"id":"EndNoneEvent"},"childShapes":[],"outgoing":[],"bounds":{"lowerRight":{"x":598,"y":69},"upperLeft":{"x":570,"y":41}},"dockers":[]},{"resourceId":"sid-E566A795-7E56-4722-BB28-AC34BAD6BC7C","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":"false"},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C"}],"bounds":{"lowerRight":{"x":569.375,"y":55},"upperLeft":{"x":525.390625,"y":55}},"dockers":[{"x":50,"y":40},{"x":14,"y":14}],"target":{"resourceId":"sid-D02B9B55-1C91-47AC-90CC-E2B60D37EA1C"}},{"resourceId":"sid-DDFE4C08-32AC-4E7C-94F1-3042337FEF98","properties":{"overrideid":"","name":"","documentation":"","conditionsequenceflow":"","executionlisteners":"","defaultflow":true},"stencil":{"id":"SequenceFlow"},"childShapes":[],"outgoing":[{"resourceId":"sid-67831254-5263-4F5D-87D2-27153F20E647"}],"bounds":{"lowerRight":{"x":569.0312525023804,"y":165.45479411913286},"upperLeft":{"x":380.70702874761963,"y":165.03348713086714}},"dockers":[{"x":20.5,"y":20.5},{"x":14,"y":14}],"target":{"resourceId":"sid-67831254-5263-4F5D-87D2-27153F20E647"}}],"bounds":{"lowerRight":{"x":1200,"y":1050},"upperLeft":{"x":0,"y":0}},"stencilset":{"url":"stencilsets/bpmn2.0/bpmn2.0.json","namespace":"http://b3mn.org/stencilset/bpmn2.0#"},"ssextensions":[]}
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343253" modeler:modelId="59064" modeler:modelVersion="3" modeler:modelLastUpdated="1506540422251" modeler:originalModelId="58059" modeler:originalModelVersion="4">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813887" modeler:modelId="59064" modeler:modelVersion="3" modeler:modelLastUpdated="1506540422251" modeler:originalModelId="58059" modeler:originalModelVersion="4">
<process id="IntermediateTimerCatchProcess" name="IntermediateTimerCatchProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343225" modeler:modelId="59068" modeler:modelVersion="2" modeler:modelLastUpdated="1506540422119" modeler:originalModelId="59066" modeler:originalModelVersion="2">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813914" modeler:modelId="59068" modeler:modelVersion="2" modeler:modelLastUpdated="1506540422119" modeler:originalModelId="59066" modeler:originalModelVersion="2">
<message id="message-boundary" name="message-boundary"/>
<message id="message-catch" name="message-catch"/>
<process id="MessageCatch" name="MessageCatch" isExecutable="true">
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343246" modeler:modelId="58058" modeler:modelVersion="7" modeler:modelLastUpdated="1506540422220">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813893" modeler:modelId="58058" modeler:modelVersion="7" modeler:modelLastUpdated="1506540422220">
<process id="NoOpProcess" name="NoOpProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343222" modeler:modelId="60060" modeler:modelVersion="2" modeler:modelLastUpdated="1506540422102" modeler:originalModelId="58060" modeler:originalModelVersion="3">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813918" modeler:modelId="60060" modeler:modelVersion="2" modeler:modelLastUpdated="1506540422102" modeler:originalModelId="58060" modeler:originalModelVersion="3">
<process id="ReceiveTaskProcess" name="ReceiveTaskProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343265" modeler:modelId="59066" modeler:modelVersion="3" modeler:modelLastUpdated="1506540422320" modeler:originalModelId="59064" modeler:originalModelVersion="1">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813876" modeler:modelId="59066" modeler:modelVersion="3" modeler:modelLastUpdated="1506540422320" modeler:originalModelId="59064" modeler:originalModelVersion="1">
<signal id="signal-catch" name="signal-catch" activiti:scope="global"/>
<signal id="signal-boundary" name="signal-boundary" activiti:scope="global"/>
<process id="SignalCatch" name="SignalCatch" isExecutable="true">
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343229" modeler:modelId="59063" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422146" modeler:originalModelId="59060" modeler:originalModelVersion="1">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813909" modeler:modelId="59063" modeler:modelVersion="4" modeler:modelLastUpdated="1506540422146" modeler:originalModelId="59060" modeler:originalModelVersion="1">
<process id="UserAssignment" name="UserAssignment" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20170929121343261" modeler:modelId="58059" modeler:modelVersion="6" modeler:modelLastUpdated="1506540422302">
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0en" modeler:exportDateTime="20171002162813880" modeler:modelId="58059" modeler:modelVersion="6" modeler:modelLastUpdated="1506540422302">
<process id="UserTaskProcess" name="UserTaskProcess" isExecutable="true">
<startEvent id="startEvent1">
<extensionElements>
......
{"referenceId":61074,"name":"user-task-form","description":"","editorJson":{"tabs":[],"fields":[],"outcomes":[{"id":null,"name":"Approve"},{"id":null,"name":"Reject"}],"javascriptEvents":[],"className":"","style":"","customFieldTemplates":{},"metadata":{},"variables":[],"customFieldsValueInfo":{},"gridsterForm":false}}
\ No newline at end of file
package com.alfresco.aps.test.process;
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventType;
import org.activiti.engine.repository.Deployment;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.alfresco.aps.example.listeners.ProcessEndExecutionListener;
import com.alfresco.aps.example.listeners.TaskAssignedTaskListener;
import com.alfresco.aps.example.listeners.TimerFiredEventListener;
import com.alfresco.aps.testutils.AbstractTest;
import com.alfresco.aps.testutils.resources.ActivitiResources;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:activiti.cfg.xml", "classpath:common-beans-and-mocks.xml", "classpath:process-beans-and-mocks.xml" })
@TestPropertySource(value="classpath:local-dev-test.properties")
public class CustomListenersUnitTest extends AbstractTest {
String appName = "Test App";
String processDefinitionKey = "CustomListeners";
@Autowired
TaskAssignedTaskListener taskAssignedTaskListener;
@Autowired
TimerFiredEventListener timerFiredEventListener;
@Autowired
ProcessEndExecutionListener processEndExecutionListener;
@Before
public void before() throws Exception {
if(env.getProperty ("aps.app.download", Boolean.class, false)){
ActivitiResources.forceGet(appName);
}
Iterator<File> it = FileUtils.iterateFiles(new File(BPMN_RESOURCE_PATH), null, false);
while (it.hasNext()) {
String bpmnXml = ((File) it.next()).getPath();
String extension = FilenameUtils.getExtension(bpmnXml);
if (extension.equals("xml")) {
activitiRule.getRepositoryService().createDeployment()
.addInputStream(bpmnXml, new FileInputStream(bpmnXml)).deploy();
}
}
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable {
Object[] arg = invocation.getArguments();
DelegateExecution execution = (DelegateExecution) arg[0];
// mock the listener stuff you require for next process step here (eg:set a variable)
execution.setVariable("processEndExecutionListener", "executed");
return null;
}
}).when(processEndExecutionListener).notify((DelegateExecution) any());
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable {
Object[] arg = invocation.getArguments();
ActivitiEvent event = (ActivitiEvent) arg[0];
assertTrue(event.getType().equals(ActivitiEventType.TIMER_FIRED));
return null;
}
}).when(timerFiredEventListener).onEvent((ActivitiEvent) any());
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable {
Object[] arg = invocation.getArguments();
DelegateTask task = (DelegateTask) arg[0];
// mock the listener stuff you require for next process step here (eg:set a variable)
task.setVariable("taskAssignedTaskListener", "executed");
return null;
}
}).when(taskAssignedTaskListener).notify((DelegateTask) any());
}
@After
public void after() {
List<Deployment> deploymentList = activitiRule.getRepositoryService().createDeploymentQuery().list();
for (Deployment deployment : deploymentList) {
activitiRule.getRepositoryService().deleteDeployment(deployment.getId(), true);
}
}
@Test
public void testProcessExecution() throws Exception {
Map<String, Object> processVars = new HashMap<String, Object>();
processVars.put("initiator", "$INITIATOR");
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKey(processDefinitionKey, processVars);
assertNotNull(processInstance);
assertEquals(1, taskService.createTaskQuery().count());
Task task = taskService.createTaskQuery().singleResult();
verify(taskAssignedTaskListener, times(1)).notify((DelegateTask) any());
taskService.complete(task.getId());
unitTestHelpers.assertTimerJobsTimeInSecondsLowerThan(120, true);
verify(timerFiredEventListener, times(1)).onEvent((ActivitiEvent) any());
verify(processEndExecutionListener, times(1)).notify((DelegateExecution) any());
unitTestHelpers.assertNullProcessInstance(processInstance.getProcessInstanceId());
Map<String, Object> variablesToAssert = new HashMap<String, Object>();
variablesToAssert.put("taskAssignedTaskListener", "executed");
variablesToAssert.put("processEndExecutionListener", "executed");
unitTestHelpers.assertHistoricVariableValues(processInstance.getProcessInstanceId(), variablesToAssert);
}
}
\ No newline at end of file
package com.alfresco.aps.test.process;
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.annotation.meta.When;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.repository.Deployment;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.alfresco.aps.mockdelegates.FlowConditionsBean;
import com.alfresco.aps.testutils.AbstractTest;
import com.alfresco.aps.testutils.resources.ActivitiResources;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import static org.junit.Assert.*;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.when;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:activiti.cfg.xml", "classpath:common-beans-and-mocks.xml" })
@TestPropertySource(value="classpath:local-dev-test.properties")