added updated dockerfiles and ric workflow
[it/otf.git] / oran-ric-test-head / workflows / Delete_xAPP_Test.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:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0x9ttcz" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.1">
3   <bpmn:process id="Delete_xAPP_Test" isExecutable="true">
4     <bpmn:startEvent id="StartEvent_0cebtfp" camunda:asyncBefore="true">
5       <bpmn:outgoing>SequenceFlow_03vt4gu</bpmn:outgoing>
6     </bpmn:startEvent>
7     <bpmn:scriptTask id="verify" name="Verify Inputs" scriptFormat="JavaScript">
8       <bpmn:incoming>SequenceFlow_03vt4gu</bpmn:incoming>
9       <bpmn:outgoing>SequenceFlow_1gceb7d</bpmn:outgoing>
10       <bpmn:script>var System = java.lang.System 
11
12 var deleteVthId = 'delete'
13 var testData = execution.getVariable("testData")
14 var vthInput = execution.getVariable("vthInput")
15 var validInput = false;
16 var testResultMessage = "";
17
18 try{
19
20   var appName = testData['appName'];
21
22   if(typeof appName  !== 'string' || appName.trim() === ''){
23     System.out.println("appName is not a string, or empty string")
24     throw Error("appName is not a string, or empty string")
25   }
26
27
28   validInput = true
29
30   vthInput[deleteVthId].name = appName
31 }
32 catch(err){
33   System.out.println(err)
34   validInput = false
35   testResultMessage = "Invalid input params. error: " + err;
36   execution.setVariable("testResult", "FAILED");
37 }
38
39 execution.setVariable("validInput", validInput)
40 execution.setVariable("testResultMessage", testResultMessage)</bpmn:script>
41     </bpmn:scriptTask>
42     <bpmn:exclusiveGateway id="ExclusiveGateway_04n8k6e" default="SequenceFlow_035k1kv">
43       <bpmn:incoming>SequenceFlow_1gceb7d</bpmn:incoming>
44       <bpmn:outgoing>SequenceFlow_1xykozf</bpmn:outgoing>
45       <bpmn:outgoing>SequenceFlow_035k1kv</bpmn:outgoing>
46     </bpmn:exclusiveGateway>
47     <bpmn:sequenceFlow id="SequenceFlow_03vt4gu" sourceRef="StartEvent_0cebtfp" targetRef="verify" />
48     <bpmn:sequenceFlow id="SequenceFlow_1gceb7d" sourceRef="verify" targetRef="ExclusiveGateway_04n8k6e" />
49     <bpmn:sequenceFlow id="SequenceFlow_1xykozf" name="To Delete" sourceRef="ExclusiveGateway_04n8k6e" targetRef="delete">
50       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${validInput}</bpmn:conditionExpression>
51     </bpmn:sequenceFlow>
52     <bpmn:scriptTask id="ScriptTask_1d0llw5" name="Mark Test Failure" scriptFormat="JavaScript">
53       <bpmn:incoming>SequenceFlow_035k1kv</bpmn:incoming>
54       <bpmn:incoming>SequenceFlow_11htm0z</bpmn:incoming>
55       <bpmn:outgoing>SequenceFlow_1ivi698</bpmn:outgoing>
56       <bpmn:script>execution.setVariable("testResult", "FAILED")</bpmn:script>
57     </bpmn:scriptTask>
58     <bpmn:scriptTask id="ScriptTask_0zeodmx" name="Mark Test Success" scriptFormat="JavaScript">
59       <bpmn:incoming>SequenceFlow_1fcorq2</bpmn:incoming>
60       <bpmn:outgoing>SequenceFlow_1s62i1u</bpmn:outgoing>
61       <bpmn:script>execution.setVariable("testResult", "SUCCESS")</bpmn:script>
62     </bpmn:scriptTask>
63     <bpmn:endEvent id="EndEvent_0wf03rq">
64       <bpmn:incoming>SequenceFlow_1czqxne</bpmn:incoming>
65       <bpmn:terminateEventDefinition id="TerminateEventDefinition_1o1stwj" />
66     </bpmn:endEvent>
67     <bpmn:sequenceFlow id="SequenceFlow_1ivi698" sourceRef="ScriptTask_1d0llw5" targetRef="ServiceTask_0yfqtmz" />
68     <bpmn:sequenceFlow id="SequenceFlow_1s62i1u" sourceRef="ScriptTask_0zeodmx" targetRef="ServiceTask_0yfqtmz" />
69     <bpmn:sequenceFlow id="SequenceFlow_1czqxne" sourceRef="ServiceTask_0yfqtmz" targetRef="EndEvent_0wf03rq" />
70     <bpmn:exclusiveGateway id="ExclusiveGateway_0df2lf1" default="SequenceFlow_11htm0z">
71       <bpmn:incoming>SequenceFlow_1hq011g</bpmn:incoming>
72       <bpmn:outgoing>SequenceFlow_1fcorq2</bpmn:outgoing>
73       <bpmn:outgoing>SequenceFlow_11htm0z</bpmn:outgoing>
74     </bpmn:exclusiveGateway>
75     <bpmn:sequenceFlow id="SequenceFlow_1rdc2w4" sourceRef="delete" targetRef="checkDelete" />
76     <bpmn:sequenceFlow id="SequenceFlow_1fcorq2" name="Deleted" sourceRef="ExclusiveGateway_0df2lf1" targetRef="ScriptTask_0zeodmx">
77       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${deleted}</bpmn:conditionExpression>
78     </bpmn:sequenceFlow>
79     <bpmn:sequenceFlow id="SequenceFlow_035k1kv" sourceRef="ExclusiveGateway_04n8k6e" targetRef="ScriptTask_1d0llw5" />
80     <bpmn:sequenceFlow id="SequenceFlow_11htm0z" sourceRef="ExclusiveGateway_0df2lf1" targetRef="ScriptTask_1d0llw5" />
81     <bpmn:scriptTask id="checkDelete" name="Verify Delete" scriptFormat="JavaScript">
82       <bpmn:incoming>SequenceFlow_1rdc2w4</bpmn:incoming>
83       <bpmn:outgoing>SequenceFlow_1hq011g</bpmn:outgoing>
84       <bpmn:script>var System = java.lang.System 
85
86 var deleteVthId = 'delete'
87 var testData = execution.getVariable("testData")
88 var vthInput = execution.getVariable("vthInput")
89 var deleted = false;
90 var testResultMessage = "RIC VTH reported that the xapp was not deleted."
91
92
93
94 try {
95   //get output from delete call
96   var testExecution = execution.getVariable('otf-execution-testExecution');
97   var data = null;
98   testExecution.testHeadResults.forEach(function(item, index, array) {
99     if(item.bpmnVthTaskId == deleteVthId ){
100       data = item['testHeadResponse']['vthResponse']['resultData']['statusCode'];
101     }
102   })
103   
104   if(data === 204){
105     deleted = true
106     testResultMessage = "RIC VTH reported that the xapp was deleted."
107   }
108   
109 }
110 catch(err) {
111   deleted = false
112 }
113
114 execution.setVariable("deleted", deleted);
115 execution.setVariable("testResultMessage", testResultMessage);</bpmn:script>
116     </bpmn:scriptTask>
117     <bpmn:sequenceFlow id="SequenceFlow_1hq011g" sourceRef="checkDelete" targetRef="ExclusiveGateway_0df2lf1" />
118     <bpmn:task id="ServiceTask_0yfqtmz" name="UTIL:LogTestResult">
119       <bpmn:incoming>SequenceFlow_1ivi698</bpmn:incoming>
120       <bpmn:incoming>SequenceFlow_1s62i1u</bpmn:incoming>
121       <bpmn:outgoing>SequenceFlow_1czqxne</bpmn:outgoing>
122     </bpmn:task>
123     <bpmn:task id="delete" name="LVTH:RIC:Delete">
124       <bpmn:incoming>SequenceFlow_1xykozf</bpmn:incoming>
125       <bpmn:outgoing>SequenceFlow_1rdc2w4</bpmn:outgoing>
126     </bpmn:task>
127   </bpmn:process>
128   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
129     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Delete_xAPP_Test">
130       <bpmndi:BPMNShape id="StartEvent_0cebtfp_di" bpmnElement="StartEvent_0cebtfp">
131         <dc:Bounds x="156" y="103" width="36" height="36" />
132       </bpmndi:BPMNShape>
133       <bpmndi:BPMNShape id="ScriptTask_0rqy7r1_di" bpmnElement="verify">
134         <dc:Bounds x="234" y="81" width="100" height="80" />
135       </bpmndi:BPMNShape>
136       <bpmndi:BPMNShape id="ExclusiveGateway_04n8k6e_di" bpmnElement="ExclusiveGateway_04n8k6e" isMarkerVisible="true">
137         <dc:Bounds x="385" y="96" width="50" height="50" />
138       </bpmndi:BPMNShape>
139       <bpmndi:BPMNEdge id="SequenceFlow_03vt4gu_di" bpmnElement="SequenceFlow_03vt4gu">
140         <di:waypoint x="192" y="121" />
141         <di:waypoint x="234" y="121" />
142       </bpmndi:BPMNEdge>
143       <bpmndi:BPMNEdge id="SequenceFlow_1gceb7d_di" bpmnElement="SequenceFlow_1gceb7d">
144         <di:waypoint x="334" y="121" />
145         <di:waypoint x="385" y="121" />
146       </bpmndi:BPMNEdge>
147       <bpmndi:BPMNEdge id="SequenceFlow_1xykozf_di" bpmnElement="SequenceFlow_1xykozf">
148         <di:waypoint x="435" y="121" />
149         <di:waypoint x="489" y="121" />
150         <bpmndi:BPMNLabel>
151           <dc:Bounds x="434" y="100" width="46" height="14" />
152         </bpmndi:BPMNLabel>
153       </bpmndi:BPMNEdge>
154       <bpmndi:BPMNShape id="ScriptTask_1d0llw5_di" bpmnElement="ScriptTask_1d0llw5">
155         <dc:Bounds x="749" y="336" width="100" height="80" />
156       </bpmndi:BPMNShape>
157       <bpmndi:BPMNShape id="ScriptTask_0zeodmx_di" bpmnElement="ScriptTask_0zeodmx">
158         <dc:Bounds x="878" y="81" width="100" height="80" />
159       </bpmndi:BPMNShape>
160       <bpmndi:BPMNShape id="EndEvent_0wf03rq_di" bpmnElement="EndEvent_0wf03rq">
161         <dc:Bounds x="1169" y="103" width="36" height="36" />
162       </bpmndi:BPMNShape>
163       <bpmndi:BPMNEdge id="SequenceFlow_1ivi698_di" bpmnElement="SequenceFlow_1ivi698">
164         <di:waypoint x="849" y="376" />
165         <di:waypoint x="1065" y="376" />
166         <di:waypoint x="1065" y="161" />
167       </bpmndi:BPMNEdge>
168       <bpmndi:BPMNEdge id="SequenceFlow_1s62i1u_di" bpmnElement="SequenceFlow_1s62i1u">
169         <di:waypoint x="978" y="121" />
170         <di:waypoint x="1015" y="121" />
171       </bpmndi:BPMNEdge>
172       <bpmndi:BPMNEdge id="SequenceFlow_1czqxne_di" bpmnElement="SequenceFlow_1czqxne">
173         <di:waypoint x="1115" y="121" />
174         <di:waypoint x="1169" y="121" />
175       </bpmndi:BPMNEdge>
176       <bpmndi:BPMNShape id="ExclusiveGateway_0df2lf1_di" bpmnElement="ExclusiveGateway_0df2lf1" isMarkerVisible="true">
177         <dc:Bounds x="774" y="96" width="50" height="50" />
178       </bpmndi:BPMNShape>
179       <bpmndi:BPMNEdge id="SequenceFlow_1rdc2w4_di" bpmnElement="SequenceFlow_1rdc2w4">
180         <di:waypoint x="589" y="121" />
181         <di:waypoint x="629" y="121" />
182       </bpmndi:BPMNEdge>
183       <bpmndi:BPMNEdge id="SequenceFlow_1fcorq2_di" bpmnElement="SequenceFlow_1fcorq2">
184         <di:waypoint x="824" y="121" />
185         <di:waypoint x="878" y="121" />
186         <bpmndi:BPMNLabel>
187           <dc:Bounds x="827" y="99" width="38" height="14" />
188         </bpmndi:BPMNLabel>
189       </bpmndi:BPMNEdge>
190       <bpmndi:BPMNEdge id="SequenceFlow_035k1kv_di" bpmnElement="SequenceFlow_035k1kv">
191         <di:waypoint x="410" y="146" />
192         <di:waypoint x="410" y="376" />
193         <di:waypoint x="749" y="376" />
194       </bpmndi:BPMNEdge>
195       <bpmndi:BPMNEdge id="SequenceFlow_11htm0z_di" bpmnElement="SequenceFlow_11htm0z">
196         <di:waypoint x="799" y="146" />
197         <di:waypoint x="799" y="336" />
198       </bpmndi:BPMNEdge>
199       <bpmndi:BPMNShape id="ScriptTask_0td2q01_di" bpmnElement="checkDelete">
200         <dc:Bounds x="629" y="81" width="100" height="80" />
201       </bpmndi:BPMNShape>
202       <bpmndi:BPMNEdge id="SequenceFlow_1hq011g_di" bpmnElement="SequenceFlow_1hq011g">
203         <di:waypoint x="729" y="121" />
204         <di:waypoint x="774" y="121" />
205       </bpmndi:BPMNEdge>
206       <bpmndi:BPMNShape id="Task_1tklwc0_di" bpmnElement="ServiceTask_0yfqtmz">
207         <dc:Bounds x="1015" y="81" width="100" height="80" />
208       </bpmndi:BPMNShape>
209       <bpmndi:BPMNShape id="Task_026zsim_di" bpmnElement="delete">
210         <dc:Bounds x="489" y="81" width="100" height="80" />
211       </bpmndi:BPMNShape>
212     </bpmndi:BPMNPlane>
213   </bpmndi:BPMNDiagram>
214 </bpmn:definitions>