Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / test / resources / testAsyncResource.bpmn
1 <?xml version="1.0" encoding="UTF-8"?>
2 <bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" 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" id="_l2hJ8CccEeW3d--PaFJMbg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
3   <bpmn2:process id="testAsyncProcess" name="testAsyncProcess" isExecutable="true">
4     <bpmn2:startEvent id="ReceiveQueryAAIMessage" name="Receive Message">
5       <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
6       <bpmn2:messageEventDefinition id="_MessageEventDefinition_3" messageRef="Message_2" />
7     </bpmn2:startEvent>
8     <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="ReceiveQueryAAIMessage" targetRef="ScriptTask_5" />
9     <bpmn2:scriptTask id="ScriptTask_5" name="Send Response and continue execution" scriptFormat="groovy">
10       <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
11       <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing>
12       <bpmn2:script><![CDATA[//import java.net.InetAddress;
13 import org.onap.so.bpmn.common.workflow.service.*
14
15 //def hostname = InetAddress.getLocalHost().getCanonicalHostName()
16 //println ("my host name =================" + hostname)
17
18 WorkflowCallbackResponse callbackResponse = new WorkflowCallbackResponse()
19 callbackResponse.setStatusCode(200)
20 callbackResponse.setMessage("Success")
21 callbackResponse.setResponse("Received the request, the process is getting executed, request message" + execution.getVariable("testAsyncRequestMsg"))
22
23 WorkflowContextHolder.getInstance().processCallback("testAsyncProcess", execution.getProcessInstanceId(), execution.getVariable("mso-request-id"), callbackResponse)
24
25 //def callbackUrl = "http://" + hostname  + ":28080/mso/async/services/callback/asyncQueryAAICustomer/"+ execution.getProcessInstanceId() + "/" + execution.getVariable("mso-request-id")
26 //println "callback url" + callbackUrl
27 //execution.setVariable("callbackUrl", callbackUrl)]]></bpmn2:script>
28     </bpmn2:scriptTask>
29     <bpmn2:scriptTask id="ScriptTask_6" name="Wait Script Task" scriptFormat="groovy">
30       <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming>
31       <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing>
32       <bpmn2:script><![CDATA[//Just sleep for a second
33 Thread.sleep(1000)
34 execution.setVariable("completed",true)]]></bpmn2:script>
35     </bpmn2:scriptTask>
36     <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="ScriptTask_5" targetRef="ScriptTask_6" />
37     <bpmn2:endEvent id="EndEvent_4">
38       <bpmn2:incoming>SequenceFlow_11</bpmn2:incoming>
39     </bpmn2:endEvent>
40     <bpmn2:sequenceFlow id="SequenceFlow_11" name="" sourceRef="ScriptTask_6" targetRef="EndEvent_4" />
41   </bpmn2:process>
42   <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
43   <bpmn2:message id="Message_2" name="testAsyncRequestMsg" />
44   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
45     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="testAsyncProcess">
46       <bpmndi:BPMNShape id="_BPMNShape_StartEvent_33" bpmnElement="ReceiveQueryAAIMessage">
47         <dc:Bounds x="182" y="145" width="36" height="36" />
48         <bpmndi:BPMNLabel>
49           <dc:Bounds x="133" y="186" width="134" height="25" />
50         </bpmndi:BPMNLabel>
51       </bpmndi:BPMNShape>
52       <bpmndi:BPMNShape id="_BPMNShape_EndEvent_88" bpmnElement="EndEvent_4">
53         <dc:Bounds x="708" y="145" width="36" height="36" />
54         <bpmndi:BPMNLabel>
55           <dc:Bounds x="726" y="186" width="0" height="0" />
56         </bpmndi:BPMNLabel>
57       </bpmndi:BPMNShape>
58       <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_76" bpmnElement="ScriptTask_5">
59         <dc:Bounds x="372" y="123" width="100" height="80" />
60       </bpmndi:BPMNShape>
61       <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_33" targetElement="_BPMNShape_ScriptTask_76">
62         <di:waypoint xsi:type="dc:Point" x="218" y="163" />
63         <di:waypoint xsi:type="dc:Point" x="372" y="163" />
64         <bpmndi:BPMNLabel>
65           <dc:Bounds x="268" y="163" width="6" height="6" />
66         </bpmndi:BPMNLabel>
67       </bpmndi:BPMNEdge>
68       <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_123" bpmnElement="ScriptTask_6">
69         <dc:Bounds x="522" y="123" width="100" height="80" />
70       </bpmndi:BPMNShape>
71       <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_ScriptTask_76" targetElement="_BPMNShape_ScriptTask_123">
72         <di:waypoint xsi:type="dc:Point" x="472" y="163" />
73         <di:waypoint xsi:type="dc:Point" x="522" y="163" />
74       </bpmndi:BPMNEdge>
75       <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ScriptTask_123" targetElement="_BPMNShape_EndEvent_88">
76         <di:waypoint xsi:type="dc:Point" x="622" y="163" />
77         <di:waypoint xsi:type="dc:Point" x="708" y="163" />
78       </bpmndi:BPMNEdge>
79     </bpmndi:BPMNPlane>
80   </bpmndi:BPMNDiagram>
81 </bpmn2:definitions>