Fix rollback
[so.git] / bpmn / so-bpmn-building-blocks / src / main / resources / subprocess / BuildingBlock / ExecuteBuildingBlock.bpmn
1 <?xml version="1.0" encoding="UTF-8"?>
2 <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2">
3   <bpmn:process id="ExecuteBuildingBlock" name="ExecuteBuildingBlock" isExecutable="true">
4     <bpmn:startEvent id="Start_ExecuteBuildingBlock" name="start">
5       <bpmn:outgoing>SequenceFlow_0rq4c5r</bpmn:outgoing>
6     </bpmn:startEvent>
7     <bpmn:callActivity id="Call_BBToExecute" name="BB to Execute" calledElement="${flowToBeCalled}">
8       <bpmn:extensionElements>
9         <camunda:in source="gBuildingBlockExecution" target="gBuildingBlockExecution" />
10         <camunda:out source="WorkflowException" target="WorkflowException" />
11         <camunda:in source="mso-request-id" target="mso-request-id" />
12       </bpmn:extensionElements>
13       <bpmn:incoming>Continue</bpmn:incoming>
14       <bpmn:outgoing>SequenceFlow_01h9qmz</bpmn:outgoing>
15     </bpmn:callActivity>
16     <bpmn:sequenceFlow id="SequenceFlow_0rq4c5r" sourceRef="Start_ExecuteBuildingBlock" targetRef="Task_BBInputSetup" />
17     <bpmn:sequenceFlow id="SequenceFlow_0uzwjrq" sourceRef="Task_BBInputSetup" targetRef="StatusPolicy" />
18     <bpmn:serviceTask id="Task_BBInputSetup" name="BB Input Setup" camunda:expression="${BBInputSetup.execute(execution)}">
19       <bpmn:incoming>SequenceFlow_0rq4c5r</bpmn:incoming>
20       <bpmn:outgoing>SequenceFlow_0uzwjrq</bpmn:outgoing>
21     </bpmn:serviceTask>
22     <bpmn:endEvent id="End_ExecuteBuildingBlock" name="end">
23       <bpmn:incoming>SequenceFlow_16lmcxp</bpmn:incoming>
24     </bpmn:endEvent>
25     <bpmn:sequenceFlow id="SequenceFlow_01h9qmz" sourceRef="Call_BBToExecute" targetRef="Task_setHandlingCodeSuccess" />
26     <bpmn:sequenceFlow id="Continue" name="Continue" sourceRef="CheckOrchestrationStatusValidationResults" targetRef="Call_BBToExecute" />
27     <bpmn:serviceTask id="StatusPolicy" name="StatusPolicy" camunda:expression="${OrchestrationStatusValidator.validateOrchestrationStatus(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
28       <bpmn:incoming>SequenceFlow_0uzwjrq</bpmn:incoming>
29       <bpmn:outgoing>SequenceFlow_0je0y25</bpmn:outgoing>
30     </bpmn:serviceTask>
31     <bpmn:exclusiveGateway id="CheckOrchestrationStatusValidationResults" name="Check OrchestrationStatus Validation Results" default="Continue">
32       <bpmn:incoming>SequenceFlow_0je0y25</bpmn:incoming>
33       <bpmn:outgoing>Continue</bpmn:outgoing>
34       <bpmn:outgoing>SequenceFlow_1j0vskt</bpmn:outgoing>
35     </bpmn:exclusiveGateway>
36     <bpmn:sequenceFlow id="SequenceFlow_0je0y25" sourceRef="StatusPolicy" targetRef="CheckOrchestrationStatusValidationResults" />
37     <bpmn:subProcess id="SubProcess_0tv8zda" name="Error Handling&#10;&#10;" triggeredByEvent="true">
38       <bpmn:startEvent id="StartEvent_0tmcs9g">
39         <bpmn:outgoing>SequenceFlow_09synl9</bpmn:outgoing>
40         <bpmn:errorEventDefinition />
41       </bpmn:startEvent>
42       <bpmn:sequenceFlow id="SequenceFlow_09synl9" sourceRef="StartEvent_0tmcs9g" targetRef="Task_QueryRainyDayTable" />
43       <bpmn:serviceTask id="Task_QueryRainyDayTable" name="QueryRainyDayTable" camunda:expression="${ExecuteBuildingBlockRainyDay.queryRainyDayTable(execution)}">
44         <bpmn:incoming>SequenceFlow_09synl9</bpmn:incoming>
45         <bpmn:outgoing>SequenceFlow_0a62t4c</bpmn:outgoing>
46       </bpmn:serviceTask>
47       <bpmn:endEvent id="ErrorEnd2">
48         <bpmn:incoming>SequenceFlow_1db2c7t</bpmn:incoming>
49       </bpmn:endEvent>
50       <bpmn:exclusiveGateway id="ExclusiveGateway_1aonzik" name="Check HandlingCode" default="SequenceFlow_0h8v45y">
51         <bpmn:incoming>SequenceFlow_0a62t4c</bpmn:incoming>
52         <bpmn:outgoing>SequenceFlow_0fwsjva</bpmn:outgoing>
53         <bpmn:outgoing>SequenceFlow_0h8v45y</bpmn:outgoing>
54       </bpmn:exclusiveGateway>
55       <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_RetryTimer" name="RetryTimer">
56         <bpmn:incoming>SequenceFlow_0ndt8ft</bpmn:incoming>
57         <bpmn:outgoing>SequenceFlow_07a1ytc</bpmn:outgoing>
58         <bpmn:timerEventDefinition>
59           <bpmn:timeDuration xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("RetryDuration")}]]></bpmn:timeDuration>
60         </bpmn:timerEventDefinition>
61       </bpmn:intermediateCatchEvent>
62       <bpmn:exclusiveGateway id="ExclusiveGateway_0ey4zpt" name="Retries Left?">
63         <bpmn:incoming>SequenceFlow_0fwsjva</bpmn:incoming>
64         <bpmn:outgoing>SequenceFlow_1wbevp0</bpmn:outgoing>
65         <bpmn:outgoing>SequenceFlow_1db2c7t</bpmn:outgoing>
66       </bpmn:exclusiveGateway>
67       <bpmn:serviceTask id="Task_SetRetryTimer" name="Set Retry Timer" camunda:expression="${ExecuteBuildingBlockRainyDay.setRetryTimer(execution)}">
68         <bpmn:incoming>SequenceFlow_1wbevp0</bpmn:incoming>
69         <bpmn:outgoing>SequenceFlow_0ndt8ft</bpmn:outgoing>
70       </bpmn:serviceTask>
71       <bpmn:sequenceFlow id="SequenceFlow_0a62t4c" sourceRef="Task_QueryRainyDayTable" targetRef="ExclusiveGateway_1aonzik" />
72       <bpmn:sequenceFlow id="SequenceFlow_0h8v45y" name="Rollback or Abort" sourceRef="ExclusiveGateway_1aonzik" targetRef="EndEvent_0mvmk3i" />
73       <bpmn:sequenceFlow id="SequenceFlow_1db2c7t" name="no" sourceRef="ExclusiveGateway_0ey4zpt" targetRef="ErrorEnd2" />
74       <bpmn:sequenceFlow id="SequenceFlow_0fwsjva" name="Retry" sourceRef="ExclusiveGateway_1aonzik" targetRef="ExclusiveGateway_0ey4zpt">
75         <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Retry"}]]></bpmn:conditionExpression>
76       </bpmn:sequenceFlow>
77       <bpmn:sequenceFlow id="SequenceFlow_0ndt8ft" sourceRef="Task_SetRetryTimer" targetRef="IntermediateCatchEvent_RetryTimer" />
78       <bpmn:sequenceFlow id="SequenceFlow_07a1ytc" sourceRef="IntermediateCatchEvent_RetryTimer" targetRef="EndEvent_1sez2lh" />
79       <bpmn:sequenceFlow id="SequenceFlow_1wbevp0" name="yes" sourceRef="ExclusiveGateway_0ey4zpt" targetRef="Task_SetRetryTimer">
80         <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("retryCount")<5}]]></bpmn:conditionExpression>
81       </bpmn:sequenceFlow>
82       <bpmn:endEvent id="EndEvent_0mvmk3i">
83         <bpmn:incoming>SequenceFlow_0h8v45y</bpmn:incoming>
84       </bpmn:endEvent>
85       <bpmn:endEvent id="EndEvent_1sez2lh" name="end">
86         <bpmn:incoming>SequenceFlow_07a1ytc</bpmn:incoming>
87         <bpmn:terminateEventDefinition />
88       </bpmn:endEvent>
89     </bpmn:subProcess>
90     <bpmn:sequenceFlow id="SequenceFlow_16lmcxp" sourceRef="Task_setHandlingCodeSuccess" targetRef="End_ExecuteBuildingBlock" />
91     <bpmn:sequenceFlow id="SequenceFlow_1j0vskt" name="Silent Success" sourceRef="CheckOrchestrationStatusValidationResults" targetRef="Task_setHandlingCodeSuccess">
92       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("orchestrationStatusValidationResult").name() ==  "SILENT_SUCCESS"}]]></bpmn:conditionExpression>
93     </bpmn:sequenceFlow>
94     <bpmn:serviceTask id="Task_setHandlingCodeSuccess" name="Set Handling Code To Success" camunda:expression="${ExecuteBuildingBlockRainyDay.setHandlingStatusSuccess(execution)}">
95       <bpmn:incoming>SequenceFlow_01h9qmz</bpmn:incoming>
96       <bpmn:incoming>SequenceFlow_1j0vskt</bpmn:incoming>
97       <bpmn:outgoing>SequenceFlow_16lmcxp</bpmn:outgoing>
98     </bpmn:serviceTask>
99   </bpmn:process>
100   <bpmn:error id="Error_0tnktdw" name="Error" errorCode="java.lang.Exception" />
101   <bpmn:error id="Error_17zcdbk" name="Bpmn Error" />
102   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
103     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ExecuteBuildingBlock">
104       <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="Start_ExecuteBuildingBlock">
105         <dc:Bounds x="42" y="162" width="36" height="36" />
106         <bpmndi:BPMNLabel>
107           <dc:Bounds x="49" y="198" width="23" height="12" />
108         </bpmndi:BPMNLabel>
109       </bpmndi:BPMNShape>
110       <bpmndi:BPMNShape id="CallActivity_0n67obl_di" bpmnElement="Call_BBToExecute">
111         <dc:Bounds x="589" y="140" width="100" height="80" />
112       </bpmndi:BPMNShape>
113       <bpmndi:BPMNEdge id="SequenceFlow_0rq4c5r_di" bpmnElement="SequenceFlow_0rq4c5r">
114         <di:waypoint xsi:type="dc:Point" x="78" y="180" />
115         <di:waypoint xsi:type="dc:Point" x="141" y="180" />
116         <bpmndi:BPMNLabel>
117           <dc:Bounds x="65" y="165" width="90" height="0" />
118         </bpmndi:BPMNLabel>
119       </bpmndi:BPMNEdge>
120       <bpmndi:BPMNEdge id="SequenceFlow_0uzwjrq_di" bpmnElement="SequenceFlow_0uzwjrq">
121         <di:waypoint xsi:type="dc:Point" x="241" y="180" />
122         <di:waypoint xsi:type="dc:Point" x="307" y="180" />
123         <bpmndi:BPMNLabel>
124           <dc:Bounds x="229" y="165" width="90" height="0" />
125         </bpmndi:BPMNLabel>
126       </bpmndi:BPMNEdge>
127       <bpmndi:BPMNShape id="ServiceTask_1jcuk3b_di" bpmnElement="Task_BBInputSetup">
128         <dc:Bounds x="141" y="140" width="100" height="80" />
129       </bpmndi:BPMNShape>
130       <bpmndi:BPMNShape id="EndEvent_0ahsxzi_di" bpmnElement="End_ExecuteBuildingBlock">
131         <dc:Bounds x="871" y="162" width="36" height="36" />
132         <bpmndi:BPMNLabel>
133           <dc:Bounds x="880" y="202" width="18" height="12" />
134         </bpmndi:BPMNLabel>
135       </bpmndi:BPMNShape>
136       <bpmndi:BPMNEdge id="SequenceFlow_01h9qmz_di" bpmnElement="SequenceFlow_01h9qmz">
137         <di:waypoint xsi:type="dc:Point" x="689" y="180" />
138         <di:waypoint xsi:type="dc:Point" x="731" y="180" />
139         <bpmndi:BPMNLabel>
140           <dc:Bounds x="665" y="159" width="90" height="12" />
141         </bpmndi:BPMNLabel>
142       </bpmndi:BPMNEdge>
143       <bpmndi:BPMNShape id="ExclusiveGateway_0ey4zpt_di" bpmnElement="ExclusiveGateway_0ey4zpt" isMarkerVisible="true">
144         <dc:Bounds x="435" y="467" width="50" height="50" />
145         <bpmndi:BPMNLabel>
146           <dc:Bounds x="430" y="442" width="62" height="12" />
147         </bpmndi:BPMNLabel>
148       </bpmndi:BPMNShape>
149       <bpmndi:BPMNShape id="IntermediateCatchEvent_0qjyidb_di" bpmnElement="IntermediateCatchEvent_RetryTimer">
150         <dc:Bounds x="668" y="474" width="36" height="36" />
151         <bpmndi:BPMNLabel>
152           <dc:Bounds x="658" y="449" width="56" height="12" />
153         </bpmndi:BPMNLabel>
154       </bpmndi:BPMNShape>
155       <bpmndi:BPMNShape id="ExclusiveGateway_1aonzik_di" bpmnElement="ExclusiveGateway_1aonzik" isMarkerVisible="true">
156         <dc:Bounds x="324" y="467" width="50" height="50" />
157         <bpmndi:BPMNLabel>
158           <dc:Bounds x="315" y="429" width="68" height="24" />
159         </bpmndi:BPMNLabel>
160       </bpmndi:BPMNShape>
161       <bpmndi:BPMNEdge id="SequenceFlow_1wbevp0_di" bpmnElement="SequenceFlow_1wbevp0">
162         <di:waypoint xsi:type="dc:Point" x="485" y="492" />
163         <di:waypoint xsi:type="dc:Point" x="539" y="492" />
164         <bpmndi:BPMNLabel>
165           <dc:Bounds x="496.68461538461537" y="467" width="19" height="12" />
166         </bpmndi:BPMNLabel>
167       </bpmndi:BPMNEdge>
168       <bpmndi:BPMNEdge id="SequenceFlow_0fwsjva_di" bpmnElement="SequenceFlow_0fwsjva">
169         <di:waypoint xsi:type="dc:Point" x="374" y="492" />
170         <di:waypoint xsi:type="dc:Point" x="435" y="492" />
171         <bpmndi:BPMNLabel>
172           <dc:Bounds x="390.60897435897436" y="500" width="27" height="12" />
173         </bpmndi:BPMNLabel>
174       </bpmndi:BPMNEdge>
175       <bpmndi:BPMNEdge id="SequenceFlow_0h8v45y_di" bpmnElement="SequenceFlow_0h8v45y">
176         <di:waypoint xsi:type="dc:Point" x="349" y="517" />
177         <di:waypoint xsi:type="dc:Point" x="349" y="573" />
178         <bpmndi:BPMNLabel>
179           <dc:Bounds x="355" y="538" width="85" height="12" />
180         </bpmndi:BPMNLabel>
181       </bpmndi:BPMNEdge>
182       <bpmndi:BPMNShape id="EndEvent_0svi3iy_di" bpmnElement="ErrorEnd2">
183         <dc:Bounds x="442" y="573" width="36" height="36" />
184         <bpmndi:BPMNLabel>
185           <dc:Bounds x="452" y="613" width="18" height="12" />
186         </bpmndi:BPMNLabel>
187       </bpmndi:BPMNShape>
188       <bpmndi:BPMNShape id="ServiceTask_1tifgqh_di" bpmnElement="Task_QueryRainyDayTable">
189         <dc:Bounds x="181" y="452" width="100" height="80" />
190       </bpmndi:BPMNShape>
191       <bpmndi:BPMNEdge id="SequenceFlow_1db2c7t_di" bpmnElement="SequenceFlow_1db2c7t">
192         <di:waypoint xsi:type="dc:Point" x="460" y="517" />
193         <di:waypoint xsi:type="dc:Point" x="460" y="573" />
194         <bpmndi:BPMNLabel>
195           <dc:Bounds x="469" y="518.5833333333333" width="12" height="12" />
196         </bpmndi:BPMNLabel>
197       </bpmndi:BPMNEdge>
198       <bpmndi:BPMNEdge id="SequenceFlow_0ndt8ft_di" bpmnElement="SequenceFlow_0ndt8ft">
199         <di:waypoint xsi:type="dc:Point" x="639" y="492" />
200         <di:waypoint xsi:type="dc:Point" x="668" y="492" />
201         <bpmndi:BPMNLabel>
202           <dc:Bounds x="608.5" y="471" width="90" height="12" />
203         </bpmndi:BPMNLabel>
204       </bpmndi:BPMNEdge>
205       <bpmndi:BPMNEdge id="SequenceFlow_07a1ytc_di" bpmnElement="SequenceFlow_07a1ytc">
206         <di:waypoint xsi:type="dc:Point" x="704" y="492" />
207         <di:waypoint xsi:type="dc:Point" x="753" y="492" />
208         <bpmndi:BPMNLabel>
209           <dc:Bounds x="683.5" y="471" width="90" height="12" />
210         </bpmndi:BPMNLabel>
211       </bpmndi:BPMNEdge>
212       <bpmndi:BPMNShape id="ServiceTask_1obvxht_di" bpmnElement="Task_SetRetryTimer">
213         <dc:Bounds x="539" y="452" width="100" height="80" />
214       </bpmndi:BPMNShape>
215       <bpmndi:BPMNEdge id="SequenceFlow_0kdjsnx_di" bpmnElement="Continue">
216         <di:waypoint xsi:type="dc:Point" x="508" y="180" />
217         <di:waypoint xsi:type="dc:Point" x="589" y="180" />
218         <bpmndi:BPMNLabel>
219           <dc:Bounds x="528" y="159" width="43" height="12" />
220         </bpmndi:BPMNLabel>
221       </bpmndi:BPMNEdge>
222       <bpmndi:BPMNShape id="ServiceTask_0brnbqx_di" bpmnElement="StatusPolicy">
223         <dc:Bounds x="307" y="140" width="100" height="80" />
224       </bpmndi:BPMNShape>
225       <bpmndi:BPMNShape id="ExclusiveGateway_0f8ghh3_di" bpmnElement="CheckOrchestrationStatusValidationResults" isMarkerVisible="true">
226         <dc:Bounds x="458" y="155" width="50" height="50" />
227         <bpmndi:BPMNLabel>
228           <dc:Bounds x="442" y="209" width="87" height="48" />
229         </bpmndi:BPMNLabel>
230       </bpmndi:BPMNShape>
231       <bpmndi:BPMNEdge id="SequenceFlow_0je0y25_di" bpmnElement="SequenceFlow_0je0y25">
232         <di:waypoint xsi:type="dc:Point" x="407" y="180" />
233         <di:waypoint xsi:type="dc:Point" x="458" y="180" />
234         <bpmndi:BPMNLabel>
235           <dc:Bounds x="388" y="159" width="90" height="12" />
236         </bpmndi:BPMNLabel>
237       </bpmndi:BPMNEdge>
238       <bpmndi:BPMNEdge id="SequenceFlow_0a62t4c_di" bpmnElement="SequenceFlow_0a62t4c">
239         <di:waypoint xsi:type="dc:Point" x="281" y="492" />
240         <di:waypoint xsi:type="dc:Point" x="324" y="492" />
241         <bpmndi:BPMNLabel>
242           <dc:Bounds x="257.5" y="470.5" width="90" height="13" />
243         </bpmndi:BPMNLabel>
244       </bpmndi:BPMNEdge>
245       <bpmndi:BPMNShape id="SubProcess_0tv8zda_di" bpmnElement="SubProcess_0tv8zda" isExpanded="true">
246         <dc:Bounds x="76" y="376" width="733" height="253" />
247       </bpmndi:BPMNShape>
248       <bpmndi:BPMNShape id="StartEvent_0tmcs9g_di" bpmnElement="StartEvent_0tmcs9g">
249         <dc:Bounds x="96" y="474" width="36" height="36" />
250         <bpmndi:BPMNLabel>
251           <dc:Bounds x="24" y="510" width="0" height="12" />
252         </bpmndi:BPMNLabel>
253       </bpmndi:BPMNShape>
254       <bpmndi:BPMNEdge id="SequenceFlow_09synl9_di" bpmnElement="SequenceFlow_09synl9">
255         <di:waypoint xsi:type="dc:Point" x="132" y="492" />
256         <di:waypoint xsi:type="dc:Point" x="181" y="492" />
257         <bpmndi:BPMNLabel>
258           <dc:Bounds x="156.5" y="471" width="0" height="12" />
259         </bpmndi:BPMNLabel>
260       </bpmndi:BPMNEdge>
261       <bpmndi:BPMNShape id="EndEvent_0mvmk3i_di" bpmnElement="EndEvent_0mvmk3i">
262         <dc:Bounds x="331" y="573" width="36" height="36" />
263         <bpmndi:BPMNLabel>
264           <dc:Bounds x="349" y="613" width="0" height="12" />
265         </bpmndi:BPMNLabel>
266       </bpmndi:BPMNShape>
267       <bpmndi:BPMNShape id="EndEvent_1aww7yx_di" bpmnElement="EndEvent_1sez2lh">
268         <dc:Bounds x="753" y="474" width="36" height="36" />
269         <bpmndi:BPMNLabel>
270           <dc:Bounds x="763" y="514" width="18" height="12" />
271         </bpmndi:BPMNLabel>
272       </bpmndi:BPMNShape>
273       <bpmndi:BPMNEdge id="SequenceFlow_16lmcxp_di" bpmnElement="SequenceFlow_16lmcxp">
274         <di:waypoint xsi:type="dc:Point" x="831" y="180" />
275         <di:waypoint xsi:type="dc:Point" x="871" y="180" />
276         <bpmndi:BPMNLabel>
277           <dc:Bounds x="851" y="159" width="0" height="12" />
278         </bpmndi:BPMNLabel>
279       </bpmndi:BPMNEdge>
280       <bpmndi:BPMNEdge id="SequenceFlow_1j0vskt_di" bpmnElement="SequenceFlow_1j0vskt">
281         <di:waypoint xsi:type="dc:Point" x="483" y="155" />
282         <di:waypoint xsi:type="dc:Point" x="483" y="84" />
283         <di:waypoint xsi:type="dc:Point" x="781" y="84" />
284         <di:waypoint xsi:type="dc:Point" x="781" y="140" />
285         <bpmndi:BPMNLabel>
286           <dc:Bounds x="597" y="63" width="72" height="12" />
287         </bpmndi:BPMNLabel>
288       </bpmndi:BPMNEdge>
289       <bpmndi:BPMNShape id="ServiceTask_0z9izx5_di" bpmnElement="Task_setHandlingCodeSuccess">
290         <dc:Bounds x="731" y="140" width="100" height="80" />
291       </bpmndi:BPMNShape>
292     </bpmndi:BPMNPlane>
293   </bpmndi:BPMNDiagram>
294 </bpmn:definitions>