/
delayTimerEventProcess.bpmn
94 lines (86 loc) · 4.1 KB
/
delayTimerEventProcess.bpmn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<itemDefinition id="_timeBeforeTimerItem" />
<itemDefinition id="_timerExecutionTimeItem" />
<process processType="Private" isExecutable="true" id="org.jbpm.quickstarts.delaytimereventprocess" name="delayTimerEventProcess" tns:packageName="org.jbpm.quickstarts" >
<extensionElements>
<tns:import name="java.text.SimpleDateFormat" />
<tns:import name="java.util.Date" />
</extensionElements>
<!-- process variables -->
<property id="timeBeforeTimer" itemSubjectRef="_timeBeforeTimerItem"/>
<property id="timerExecutionTime" itemSubjectRef="_timerExecutionTimeItem"/>
<!-- nodes -->
<startEvent id="_1" name="Start" />
<endEvent id="_2" name="End" >
<terminateEventDefinition />
</endEvent>
<scriptTask id="_3" name="After Timer" scriptFormat="http://www.java.com/java" >
<script>Long timeAfter = System.currentTimeMillis();
System.out.println("After Timer - " + new SimpleDateFormat("yyyyy-mm-dd hh:mm:ss").format( new Date(timeAfter)));
timerExecutionTime = timeAfter - (Long) timeBeforeTimer;
kcontext.setVariable("timerExecutionTime", timerExecutionTime);</script>
</scriptTask>
<intermediateCatchEvent id="_4" name="Timer" >
<timerEventDefinition>
<timeDuration xsi:type="tFormalExpression">5000</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<scriptTask id="_5" name="Before Timer" scriptFormat="http://www.java.com/java" >
<script>timeBeforeTimer = System.currentTimeMillis();
System.out.println("Before Timer - " + new SimpleDateFormat("yyyyy-mm-dd hh:mm:ss").format( new Date((Long)timeBeforeTimer)));
kcontext.setVariable("timeBeforeTimer", timeBeforeTimer);</script>
</scriptTask>
<!-- connections -->
<sequenceFlow id="_3-_2" sourceRef="_3" targetRef="_2" />
<sequenceFlow id="_4-_3" sourceRef="_4" targetRef="_3" />
<sequenceFlow id="_5-_4" sourceRef="_5" targetRef="_4" />
<sequenceFlow id="_1-_5" sourceRef="_1" targetRef="_5" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="org.jbpm.quickstarts.delaytimereventprocess" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="16" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_2" >
<dc:Bounds x="463" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="326" y="16" width="105" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" >
<dc:Bounds x="246" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" >
<dc:Bounds x="96" y="16" width="118" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_3-_2" >
<di:waypoint x="378" y="40" />
<di:waypoint x="487" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_4-_3" >
<di:waypoint x="270" y="40" />
<di:waypoint x="378" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_5-_4" >
<di:waypoint x="155" y="40" />
<di:waypoint x="270" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_1-_5" >
<di:waypoint x="40" y="40" />
<di:waypoint x="155" y="40" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>