Workflow Designer Activities Implementation 17/67817/1
authorElena Kuleshov <EK1439@att.com>
Wed, 19 Sep 2018 17:41:20 +0000 (13:41 -0400)
committerElena Kuleshov <EK1439@att.com>
Wed, 19 Sep 2018 17:41:54 +0000 (13:41 -0400)
Logging changes and error message fixes for runAppcCommand()
added unit test and removed catch blocks
Workflow Designer Activities Implementation

Change-Id: I22d3d95541708ddc9e2617a92085b0d4c16caad9
Issue-ID: SO-829
Signed-off-by: Elena Kuleshov <EK1439@att.com>
23 files changed:
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestParameters.java
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/BaseBPMNTest.java
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java [new file with mode: 0644]
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java [new file with mode: 0644]
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksITTest.java [new file with mode: 0644]
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java [new file with mode: 0644]
common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java

index 24c0548..5e49ffc 100644 (file)
@@ -47,7 +47,8 @@ public class RequestParameters implements Serializable {
        private List<Map<String, Object>> userParams = new ArrayList<>();
        @JsonProperty("aLaCarte")
        private Boolean aLaCarte;
-
+       @JsonProperty("payload")
+       private String payload;
 
        public String getSubscriptionServiceType() {
                return subscriptionServiceType;
@@ -68,6 +69,13 @@ public class RequestParameters implements Serializable {
        public Boolean isaLaCarte() {
                return aLaCarte;
        }
+       
+       public String getPayload(){
+               return payload;
+       }
+       public void setPayload(String value){
+               this.payload = value;
+       }
 
        public List<Map<String, Object>> getUserParams() {
                return userParams;
index 877d5bb..0c7eb09 100644 (file)
@@ -341,6 +341,7 @@ public class BBInputSetupMapperLayer {
                requestParams.setaLaCarte(requestParameters.getALaCarte());
                requestParams.setSubscriptionServiceType(requestParameters.getSubscriptionServiceType());
                requestParams.setUserParams(requestParameters.getUserParams());
+               requestParams.setPayload(requestParameters.getPayload());
                return requestParams;
        }
 
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFHealthCheckActivity.bpmn
new file mode 100644 (file)
index 0000000..2e97206
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFHealthCheckActivity" name="VNFHealthCheckActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFHealthCheckActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFHealthCheckActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFHealthCheckActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskHealthCheck" targetRef="VNFHealthCheckActivity_End" />
+    <bpmn:serviceTask id="TaskHealthCheck" name="VNF Health Check" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionHealthCheck&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskHealthCheck" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFHealthCheckActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFHealthCheckActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFHealthCheckActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskHealthCheck">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFQuiesceTrafficActivity.bpmn
new file mode 100644 (file)
index 0000000..ac09674
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFQuiesceTrafficActivity" name="VNFQuiesceTrafficActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFQuiesceTrafficActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFQuiesceTrafficActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFQuiesceTrafficActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskQuiesceTraffic" targetRef="VNFQuiesceTrafficActivity_End" />
+    <bpmn:serviceTask id="TaskQuiesceTraffic" name="VNF Quiesce Traffic" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionQuiesceTraffic&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskQuiesceTraffic" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFQuiesceTrafficActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFQuiesceTrafficActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFQuiesceTrafficActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskQuiesceTraffic">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFResumeTrafficActivity.bpmn
new file mode 100644 (file)
index 0000000..c21072a
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFResumeTrafficActivity" name="VNFResumeTrafficActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFResumeTrafficActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFResumeTrafficActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFResumeTrafficActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskResumeTraffic" targetRef="VNFResumeTrafficActivity_End" />
+    <bpmn:serviceTask id="TaskResumeTraffic" name="VNF Resume Traffic" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionResumeTraffic&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskResumeTraffic" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFResumeTrafficActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFResumeTrafficActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFResumeTrafficActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskResumeTraffic">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFSetInMaintFlagActivity.bpmn
new file mode 100644 (file)
index 0000000..2bdb1d7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFSetInMaintFlagActivity" name="VNFSetInMaintFlagActivity&#10;" isExecutable="true">
+    <bpmn:startEvent id="VNFSetInMaintFlagActivity_Start">
+      <bpmn:outgoing>SequenceFlow_0zaz9o2</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFSetInMaintFlagActivity_End">
+      <bpmn:incoming>SequenceFlow_1jwsja5</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:serviceTask id="TaskSetInMaint" name="VNF Set InMaint Flag (AAI)" camunda:expression="${AAIFlagTasks.modifyVnfInMaintFlag(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)), true)}">
+      <bpmn:incoming>SequenceFlow_0zaz9o2</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1jwsja5</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0zaz9o2" sourceRef="VNFSetInMaintFlagActivity_Start" targetRef="TaskSetInMaint" />
+    <bpmn:sequenceFlow id="SequenceFlow_1jwsja5" sourceRef="TaskSetInMaint" targetRef="VNFSetInMaintFlagActivity_End" />
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFSetInMaintFlagActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFSetInMaintFlagActivity_Start">
+        <dc:Bounds x="104" y="76" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="122" y="112" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_1h93h9d_di" bpmnElement="VNFSetInMaintFlagActivity_End">
+        <dc:Bounds x="320" y="76" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="338" y="116" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1r380lg_di" bpmnElement="TaskSetInMaint">
+        <dc:Bounds x="192" y="54" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0zaz9o2_di" bpmnElement="SequenceFlow_0zaz9o2">
+        <di:waypoint xsi:type="dc:Point" x="140" y="94" />
+        <di:waypoint xsi:type="dc:Point" x="192" y="94" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="166" y="73" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1jwsja5_di" bpmnElement="SequenceFlow_1jwsja5">
+        <di:waypoint xsi:type="dc:Point" x="292" y="94" />
+        <di:waypoint xsi:type="dc:Point" x="320" y="94" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="306" y="79" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUnsetInMaintFlagActivity.bpmn
new file mode 100644 (file)
index 0000000..05d3fcf
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUnsetInMaintFlagActivity" name="VNFUnsetInMaintFlagActivity&#10;" isExecutable="true">
+    <bpmn:startEvent id="VNFUnsetInMaintFlagActivity_Start">
+      <bpmn:outgoing>SequenceFlow_0zaz9o2</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUnsetInMaintFlagActivity_End">
+      <bpmn:incoming>SequenceFlow_1jwsja5</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:serviceTask id="TaskUnsetInMaint" name="VNF UnSet InMaint Flag (AAI)" camunda:expression="${AAIFlagTasks.modifyVnfInMaintFlag(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)), false)}">
+      <bpmn:incoming>SequenceFlow_0zaz9o2</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1jwsja5</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0zaz9o2" sourceRef="VNFUnsetInMaintFlagActivity_Start" targetRef="TaskUnsetInMaint" />
+    <bpmn:sequenceFlow id="SequenceFlow_1jwsja5" sourceRef="TaskUnsetInMaint" targetRef="VNFUnsetInMaintFlagActivity_End" />
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUnsetInMaintFlagActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUnsetInMaintFlagActivity_Start">
+        <dc:Bounds x="104" y="76" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="122" y="112" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_1h93h9d_di" bpmnElement="VNFUnsetInMaintFlagActivity_End">
+        <dc:Bounds x="320" y="76" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="338" y="116" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1r380lg_di" bpmnElement="TaskUnsetInMaint">
+        <dc:Bounds x="192" y="54" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0zaz9o2_di" bpmnElement="SequenceFlow_0zaz9o2">
+        <di:waypoint xsi:type="dc:Point" x="140" y="94" />
+        <di:waypoint xsi:type="dc:Point" x="192" y="94" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="166" y="73" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1jwsja5_di" bpmnElement="SequenceFlow_1jwsja5">
+        <di:waypoint xsi:type="dc:Point" x="292" y="94" />
+        <di:waypoint xsi:type="dc:Point" x="320" y="94" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="306" y="79" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePostCheckActivity.bpmn
new file mode 100644 (file)
index 0000000..56c24da
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUpgradePostCheckActivity" name="VNFUpgradePostCheckActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUpgradePostCheckActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUpgradePostCheckActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradePostCheckActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradePostCheck" targetRef="VNFUpgradePostCheckActivity_End" />
+    <bpmn:serviceTask id="TaskUpgradePostCheck" name="VNF Upgrade PostCheck " camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradePostCheck&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradePostCheck" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUpgradePostCheckActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUpgradePostCheckActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUpgradePostCheckActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUpgradePostCheck">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradePreCheckActivity.bpmn
new file mode 100644 (file)
index 0000000..1ec0a18
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUpgradePreCheckActivity" name="VNFUpgradePreCheckActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUpgradePreCheckActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUpgradePreCheckActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradePreCheckActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradePreCheck" targetRef="VNFUpgradePreCheckActivity_End" />
+    <bpmn:serviceTask id="TaskUpgradePreCheck" name="VNF Upgrade PreCheck " camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradePreCheck&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradePreCheck" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUpgradePreCheckActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUpgradePreCheckActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUpgradePreCheckActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUpgradePreCheck">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFUpgradeSoftwareActivity.bpmn
new file mode 100644 (file)
index 0000000..89481a5
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0">
+  <bpmn:process id="VNFUpgradeSoftwareActivity" name="VNFUpgradeSoftwareActivity" isExecutable="true">
+    <bpmn:startEvent id="VNFUpgradeSoftwareActivity_Start">
+      <bpmn:outgoing>SequenceFlow_06vhbci</bpmn:outgoing>
+    </bpmn:startEvent>
+    <bpmn:endEvent id="VNFUpgradeSoftwareActivity_End">
+      <bpmn:incoming>SequenceFlow_01312aj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_06vhbci" sourceRef="VNFUpgradeSoftwareActivity_Start" targetRef="TaskPreProcessActivity" />
+    <bpmn:sequenceFlow id="SequenceFlow_01312aj" sourceRef="TaskUpgradeSoftware" targetRef="VNFUpgradeSoftwareActivity_End" />
+    <bpmn:serviceTask id="TaskUpgradeSoftware" name="VNF Upgrade Software" camunda:expression="${AppcRunTasks.runAppcCommand(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),execution.getVariable(&#34;actionUpgradeSoftware&#34;))}">
+      <bpmn:incoming>SequenceFlow_0cf0riu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_01312aj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0cf0riu" sourceRef="TaskPreProcessActivity" targetRef="TaskUpgradeSoftware" />
+    <bpmn:serviceTask id="TaskPreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcRunTasks.preProcessActivity(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+      <bpmn:incoming>SequenceFlow_06vhbci</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0cf0riu</bpmn:outgoing>
+    </bpmn:serviceTask>
+  </bpmn:process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFUpgradeSoftwareActivity">
+      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="VNFUpgradeSoftwareActivity_Start">
+        <dc:Bounds x="173" y="102" width="36" height="36" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_102xlzi_di" bpmnElement="VNFUpgradeSoftwareActivity_End">
+        <dc:Bounds x="561" y="102" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="579" y="138" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_06vhbci_di" bpmnElement="SequenceFlow_06vhbci">
+        <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="255" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="232" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_01312aj_di" bpmnElement="SequenceFlow_01312aj">
+        <di:waypoint xsi:type="dc:Point" x="497" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="561" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="529" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_066idx4_di" bpmnElement="TaskUpgradeSoftware">
+        <dc:Bounds x="397" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0cf0riu_di" bpmnElement="SequenceFlow_0cf0riu">
+        <di:waypoint xsi:type="dc:Point" x="355" y="120" />
+        <di:waypoint xsi:type="dc:Point" x="397" y="120" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="376" y="105" width="0" height="0" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0fti66x_di" bpmnElement="TaskPreProcessActivity">
+        <dc:Bounds x="255" y="80" width="100" height="80" />
+      </bpmndi:BPMNShape>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</bpmn:definitions>
index e8891ee..8bd4aeb 100644 (file)
@@ -38,6 +38,7 @@ import org.onap.so.bpmn.common.DelegateExecutionImpl;
 import org.onap.so.bpmn.infrastructure.aai.tasks.AAICommonTasks;
 import org.onap.so.bpmn.infrastructure.aai.tasks.AAICreateTasks;
 import org.onap.so.bpmn.infrastructure.aai.tasks.AAIDeleteTasks;
+import org.onap.so.bpmn.infrastructure.aai.tasks.AAIFlagTasks;
 import org.onap.so.bpmn.infrastructure.aai.tasks.AAIQueryTasks;
 import org.onap.so.bpmn.infrastructure.aai.tasks.AAIUpdateTasks;
 import org.onap.so.bpmn.infrastructure.adapter.network.tasks.NetworkAdapterCreateTasks;
@@ -46,6 +47,7 @@ import org.onap.so.bpmn.infrastructure.adapter.network.tasks.NetworkAdapterUpdat
 import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterCreateTasks;
 import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterDeleteTasks;
 import org.onap.so.bpmn.infrastructure.adapter.vnf.tasks.VnfAdapterImpl;
+import org.onap.so.bpmn.infrastructure.appc.tasks.AppcRunTasks;
 import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetwork;
 import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetworkBBUtils;
 import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignVnf;
@@ -105,6 +107,13 @@ public abstract class BaseBPMNTest {
 
        @MockBean
        protected AAIDeleteTasks aaiDeleteTasks;
+       
+       @MockBean
+       protected AAIFlagTasks aaiFlagTasks;
+       
+       
+       @MockBean
+       protected AppcRunTasks appcRunTasks;
 
        @MockBean
        protected SDNCActivateTasks sdncActivateTasks;
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFHealthCheckActivityTest.java
new file mode 100644 (file)
index 0000000..99e7f30
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFHealthCheckActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFHealthCheckActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskHealthCheck",                                                                 
+                               "VNFHealthCheckActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFHealthCheckActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFHealthCheckActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFHealthCheckActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskHealthCheck").hasNotPassed(                                                                   
+                               "VNFHealthCheckActivity_End");          
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFQuiesceTrafficActivityTest.java
new file mode 100644 (file)
index 0000000..2305485
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFQuiesceTrafficActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFQuiesceTrafficActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskQuiesceTraffic",                                                              
+                               "VNFQuiesceTrafficActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFQuiesceTrafficActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFQuiesceTrafficActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFQuiesceTrafficActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskQuiesceTraffic").hasNotPassed(                                                                
+                               "VNFQuiesceTrafficActivity_End");               
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFResumeTrafficActivityTest.java
new file mode 100644 (file)
index 0000000..d3ff31e
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFResumeTrafficActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFResumeTrafficActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskResumeTraffic",                                                               
+                               "VNFResumeTrafficActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFResumeTrafficActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFResumeTrafficActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFResumeTrafficActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskResumeTraffic").hasNotPassed(                                                                 
+                               "VNFResumeTrafficActivity_End");                
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetInMaintFlagActivityTest.java
new file mode 100644 (file)
index 0000000..b3b4d82
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+
+public class VNFSetInMaintFlagActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFSetInMaintFlagActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start",                          
+                               "TaskSetInMaint",                                                                  
+                               "VNFSetInMaintFlagActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFSetInMaintFlagActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
+                               .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetInMaintFlagActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFSetInMaintFlagActivity_Start",                          
+                               "TaskSetInMaint").hasNotPassed(                                                            
+                               "VNFSetInMaintFlagActivity_End");               
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetInMaintFlagActivityTest.java
new file mode 100644 (file)
index 0000000..1225da5
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+
+public class VNFUnsetInMaintFlagActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUnsetInMaintFlagActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start",                                
+                               "TaskUnsetInMaint",                                                                
+                               "VNFUnsetInMaintFlagActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFUnsetInMaintFlag_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks)
+                               .modifyVnfInMaintFlag(any(BuildingBlockExecution.class), any(boolean.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInMaintFlagActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetInMaintFlagActivity_Start",                                
+                               "TaskUnsetInMaint").hasNotPassed(                                                                  
+                               "VNFUnsetInMaintFlagActivity_End");             
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePostCheckActivityTest.java
new file mode 100644 (file)
index 0000000..288cf48
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUpgradePostCheckActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUpgradePostCheckActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradePostCheck",                                                            
+                               "VNFUpgradePostCheckActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFUpgradePostCheckActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePostCheckActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePostCheckActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradePostCheck").hasNotPassed(                                                              
+                               "VNFUpgradePostCheckActivity_End");             
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradePreCheckActivityTest.java
new file mode 100644 (file)
index 0000000..2b82197
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUpgradePreCheckActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUpgradePreCheckActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradePreCheck",                                                             
+                               "VNFUpgradePreCheckActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFUpgradePreCheckActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradePreCheckActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradePreCheckActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradePreCheck").hasNotPassed(                                                               
+                               "VNFUpgradePreCheckActivity_End");              
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUpgradeSoftwareActivityTest.java
new file mode 100644 (file)
index 0000000..93d20e9
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.bpmn.subprocess;
+
+import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.doThrow;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.runtime.ProcessInstance;
+import org.junit.Test;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.BaseBPMNTest;
+import org.onap.appc.client.lcm.model.Action;
+
+public class VNFUpgradeSoftwareActivityTest extends BaseBPMNTest{
+       @Test
+       public void sunnyDayVNFUpgradeSoftwareActivity_Test() throws InterruptedException {
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradeSoftware",                                                             
+                               "VNFUpgradeSoftwareActivity_End");
+               assertThat(pi).isEnded();
+       }
+       
+       @Test
+       public void rainyDayVNFUpgradeSoftwareActivity_Test() throws Exception {
+               doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcRunTasks)
+                               .runAppcCommand(any(BuildingBlockExecution.class), any(Action.class));
+               ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUpgradeSoftwareActivity", variables);
+               assertThat(pi).isNotNull();
+               assertThat(pi).isStarted().hasPassedInOrder("VNFUpgradeSoftwareActivity_Start",
+                               "TaskPreProcessActivity",
+                               "TaskUpgradeSoftware").hasNotPassed(                                                               
+                               "VNFUpgradeSoftwareActivity_End");              
+               assertThat(pi).isEnded();
+       }
+       
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
new file mode 100644 (file)
index 0000000..798837f
--- /dev/null
@@ -0,0 +1,171 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.appc.tasks;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Optional;
+
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
+import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.client.appc.ApplicationControllerAction;
+import org.onap.so.logger.MessageEnum;
+import org.onap.so.logger.MsoLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AppcRunTasks {
+       private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AppcRunTasks.class);
+       @Autowired
+       private ExceptionBuilder exceptionUtil;
+       @Autowired
+       private ExtractPojosForBB extractPojosForBB;
+       @Autowired
+       private CatalogDbClient catalogDbClient;
+       @Autowired
+       private ApplicationControllerAction appCClient;
+       
+       public void preProcessActivity(BuildingBlockExecution execution) {
+               execution.setVariable("actionSnapshot", Action.Snapshot);
+               execution.setVariable("actionLock", Action.Lock);
+               execution.setVariable("actionUnlock", Action.Unlock);
+               execution.setVariable("actionUpgradePreCheck", Action.UpgradePreCheck);
+               execution.setVariable("actionUpgradePostCheck", Action.UpgradePostCheck);
+               execution.setVariable("actionQuiesceTraffic", Action.QuiesceTraffic);
+               execution.setVariable("actionUpgradeBackup", Action.UpgradeBackup);
+               execution.setVariable("actionUpgradeSoftware", Action.UpgradeSoftware);
+               execution.setVariable("actionResumeTraffic", Action.ResumeTraffic);             
+               execution.setVariable("actionStop", Action.Stop);
+               execution.setVariable("actionStart", Action.Start);
+               execution.setVariable("rollbackVnfStop", false);
+               execution.setVariable("rollbackVnfLock", false);
+               execution.setVariable("rollbackQuiesceTraffic", false);
+       }
+       
+       public void runAppcCommand(BuildingBlockExecution execution, Action action) {
+               msoLogger.trace("Start runAppcCommand ");
+               String appcCode = "1002";
+               String appcMessage = "";
+               try {
+                       GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
+                       GenericVnf vnf = null;
+                       try {
+                               vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID, execution.getLookupMap().get(ResourceKey.GENERIC_VNF_ID));
+                       } catch (BBObjectNotFoundException e) {
+                               exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "No valid VNF exists");
+                       }
+                       String vnfId = vnf.getVnfId();
+                       String msoRequestId = gBBInput.getRequestContext().getMsoRequestId();
+                       String vnfName = vnf.getVnfName();
+                       String vnfType = vnf.getVnfType();
+                       
+                       String aicIdentity = execution.getVariable("aicIdentity");
+                       String vnfHostIpAddress =  vnf.getIpv4OamAddress();
+                       String vmIdList = execution.getVariable("vmIdList");
+                       String vserverIdList = execution.getVariable("vserverIdList");
+                       String identityUrl =  execution.getVariable("identityUrl");
+                       
+                       ControllerSelectionReference controllerSelectionReference = catalogDbClient.getControllerSelectionReferenceByVnfTypeAndActionCategory(vnfType, action.toString());
+                       String controllerType = controllerSelectionReference.getControllerName();
+                       
+                       String vfModuleId = null;
+                       VfModule vfModule = null;
+                       try {
+                               vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID, execution.getLookupMap().get(ResourceKey.VF_MODULE_ID));
+                       } catch (BBObjectNotFoundException e) {
+                       }
+                       if (vfModule != null) {
+                               vfModuleId = vfModule.getVfModuleId();
+                       }
+                       
+                       HashMap<String, String> payloadInfo = buildPayloadInfo(vnfName, aicIdentity, vnfHostIpAddress, vmIdList, vserverIdList,
+                                       identityUrl, vfModuleId);
+                       Optional<String> payload = null;
+                       RequestParameters requestParameters = gBBInput.getRequestContext().getRequestParameters();
+                       if(requestParameters != null){
+                               String pay = requestParameters.getPayload();
+                               if (pay != null) {
+                                       payload =  Optional.of(pay);
+                               }
+                       }                       
+                       msoLogger.debug("Running APP-C action: " + action.toString());
+                       msoLogger.debug("VNFID: " + vnfId);     
+                       appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType);
+                       appcCode = appCClient.getErrorCode();
+                       appcMessage = appCClient.getErrorMessage();
+                       mapRollbackVariables(execution, action, appcCode);
+               }
+               catch (Exception e) {
+                       msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e);
+                       appcMessage = e.getMessage();
+               }               
+               
+               msoLogger.error("Error Message: " + appcMessage);
+               msoLogger.error("ERROR CODE: " + appcCode);
+               msoLogger.trace("End of runAppCommand ");
+               if (appcCode != null && !appcCode.equals("0")) {
+                       exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
+               }
+       }
+       
+       protected void mapRollbackVariables(BuildingBlockExecution execution, Action action, String appcCode) {
+               if (appcCode.equals("0") && action != null) {
+                       if (action.equals(Action.Lock)) {
+                               execution.setVariable("rollbackVnfLock", true);
+                       } else if (action.equals(Action.Unlock)) {
+                               execution.setVariable("rollbackVnfLock", false);
+                       } else if (action.equals(Action.Start)) {
+                               execution.setVariable("rollbackVnfStop", false);
+                       } else if (action.equals(Action.Stop)) {
+                               execution.setVariable("rollbackVnfStop", true);
+                       } else if (action.equals(Action.QuiesceTraffic)) {
+                               execution.setVariable("rollbackQuiesceTraffic", true);
+                       } else if (action.equals(Action.ResumeTraffic)) {
+                               execution.setVariable("rollbackQuiesceTraffic", false);
+                       }
+               }
+       }
+       
+       private HashMap<String,String> buildPayloadInfo(String vnfName, String aicIdentity, String vnfHostIpAddress, 
+                       String vmIdList, String vserverIdList, String identityUrl, String vfModuleId) {
+               HashMap<String, String> payloadInfo = new HashMap<String, String>();
+               payloadInfo.put("vnfName", vnfName);
+               payloadInfo.put("aicIdentity", aicIdentity);
+               payloadInfo.put("vnfHostIpAddress", vnfHostIpAddress);
+               payloadInfo.put("vmIdList", vmIdList);
+               payloadInfo.put("vserverIdList", vserverIdList);
+               payloadInfo.put("identityUrl", identityUrl);
+               payloadInfo.put("vfModuleId",vfModuleId);
+               return payloadInfo;
+       }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksITTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksITTest.java
new file mode 100644 (file)
index 0000000..9e1dac6
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.appc.tasks;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import java.util.HashMap;
+import java.util.Optional;
+import java.util.UUID;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
+import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+import org.onap.so.db.catalog.beans.ControllerSelectionReference;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class AppcRunTasksITTest extends BaseTaskTest {
+       
+       @Autowired
+       private AppcRunTasks appcRunTasks;
+       
+       private GenericVnf genericVnf;
+       private RequestContext requestContext;
+       private String msoRequestId;
+
+       @Before
+       public void before() {
+               genericVnf = setGenericVnf();
+               msoRequestId = UUID.randomUUID().toString();
+               requestContext = setRequestContext();
+               requestContext.setMsoRequestId(msoRequestId);
+               gBBInput.setRequestContext(requestContext);
+       }
+       
+       @Test 
+       public void preProcessActivityTest() throws Exception {
+               appcRunTasks.preProcessActivity(execution);
+               assertEquals(execution.getVariable("actionQuiesceTraffic"), Action.QuiesceTraffic);
+               assertEquals(execution.getVariable("rollbackQuiesceTraffic"), false);           
+       }
+       
+       @Test
+       public void runAppcCommandTest() throws Exception {
+               Action action = Action.QuiesceTraffic;
+               ControllerSelectionReference controllerSelectionReference = new ControllerSelectionReference();
+               controllerSelectionReference.setControllerName("testName");
+               controllerSelectionReference.setActionCategory(action.toString());
+               controllerSelectionReference.setVnfType("testVnfType");
+               
+               doReturn(controllerSelectionReference).when(catalogDbClient).getControllerSelectionReferenceByVnfTypeAndActionCategory(genericVnf.getVnfType(), Action.QuiesceTraffic.toString());
+               
+               execution.setVariable("aicIdentity", "testAicIdentity");                
+               
+               String vnfId = genericVnf.getVnfId();
+               genericVnf.setIpv4OamAddress("testOamIpAddress");
+               String payload = "{\"testName\":\"testValue\",}";
+               RequestParameters requestParameters = new RequestParameters();
+               requestParameters.setPayload(payload);
+               gBBInput.getRequestContext().setRequestParameters(requestParameters);
+               
+               String controllerType = "testName";
+               HashMap<String, String> payloadInfo = new HashMap<String, String>();
+               payloadInfo.put("vnfName", "testVnfName1");             
+               payloadInfo.put("aicIdentity", "testAicIdentity");
+               payloadInfo.put("vnfHostIpAddress", "testOamIpAddress");
+               payloadInfo.put("vserverIdList", null);
+               payloadInfo.put("vfModuleId", null);
+               payloadInfo.put("identityUrl", null);
+               payloadInfo.put("vmIdList", null);
+               
+               doNothing().when(appCClient).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
+               
+               appcRunTasks.runAppcCommand(execution, action);
+               verify(appCClient, times(1)).runAppCCommand(action, msoRequestId, vnfId, Optional.of(payload), payloadInfo, controllerType);
+       }
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksTest.java
new file mode 100644 (file)
index 0000000..7cade77
--- /dev/null
@@ -0,0 +1,36 @@
+package org.onap.so.bpmn.infrastructure.appc.tasks;
+
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+
+import org.junit.Test;
+import org.onap.appc.client.lcm.model.Action;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+
+public class AppcRunTasksTest {
+
+       
+       private AppcRunTasks appcRunTasks = new AppcRunTasks();
+       @Test
+       public void mapRollbackVariablesTest() {
+               
+               BuildingBlockExecution mock = mock(BuildingBlockExecution.class);
+               
+               appcRunTasks.mapRollbackVariables(mock, Action.Lock, "1");
+               verify(mock, times(0)).setVariable(any(String.class), any());
+               appcRunTasks.mapRollbackVariables(mock, Action.Lock, "0");
+               verify(mock, times(1)).setVariable("rollbackVnfLock", true);
+               appcRunTasks.mapRollbackVariables(mock, Action.Unlock, "0");
+               verify(mock, times(1)).setVariable("rollbackVnfLock", false);
+               appcRunTasks.mapRollbackVariables(mock, Action.Start, "0");
+               verify(mock, times(1)).setVariable("rollbackVnfStop", false);
+               appcRunTasks.mapRollbackVariables(mock, Action.Stop, "0");
+               verify(mock, times(1)).setVariable("rollbackVnfStop", true);
+               appcRunTasks.mapRollbackVariables(mock, Action.QuiesceTraffic, "0");
+               verify(mock, times(1)).setVariable("rollbackQuiesceTraffic", true);
+               appcRunTasks.mapRollbackVariables(mock, Action.ResumeTraffic, "0");
+               verify(mock, times(1)).setVariable("rollbackQuiesceTraffic", false);
+       }
+}
index 1697a4e..e89c5c7 100644 (file)
@@ -43,6 +43,8 @@ public class RequestParameters implements Serializable {
        private List<Map<String, Object>> userParams = new ArrayList<>();
        @JsonProperty("aLaCarte")
        private Boolean aLaCarte;
+       @JsonProperty("payload")
+       private String payload;
        
        // DONOT USE. It is intended to handle older VID requests(prior to 1802)
        @Deprecated
@@ -57,9 +59,7 @@ public class RequestParameters implements Serializable {
        @JsonProperty("usePreload")
        private Boolean usePreload; // usePreload would always be true for Update
        @JsonProperty("rebuildVolumeGroups")
-       private Boolean rebuildVolumeGroups;
-       @JsonProperty("payload")
-       private String payload;
+       private Boolean rebuildVolumeGroups;    
 
        public String getSubscriptionServiceType() {
                return subscriptionServiceType;
@@ -80,6 +80,13 @@ public class RequestParameters implements Serializable {
        public Boolean isaLaCarte() {
                return aLaCarte;
        }
+       
+       public String getPayload(){
+               return payload;
+       }
+       public void setPayload(String value){
+               this.payload = value;
+       }
 
        @Deprecated
        @Transient
@@ -151,13 +158,7 @@ public class RequestParameters implements Serializable {
 
        public void setRebuildVolumeGroups(Boolean rebuildVolumeGroups) {
                this.rebuildVolumeGroups = rebuildVolumeGroups;
-       }
-       public String getPayload(){
-               return payload;
-       }
-       public void setPayload(String value){
-               this.payload = value;
-       }
+       }       
        
        @Override
        public String toString() {