summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-building-blocks/src
diff options
context:
space:
mode:
authorBonkur, Venkat <venkat.bonkur@att.com>2020-03-25 17:02:20 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-03-25 17:02:20 -0400
commita5c5b045553342376e240a506a05d0f7b947d191 (patch)
tree9084496bed0680757858dbf1853ad0eaecd5611d /bpmn/so-bpmn-building-blocks/src
parentf5420060c758308df18a0e316d6ae214ef9eb5c6 (diff)
mso vnf configuration update composite flow
Existing Change Management VNF Configuration Update flow migrated to the generic building blocks Introduced Activity BB VNFConfigModifyActivity.bpmn Updates to AppcOrcherationPreProcessor, ApplicationControllerTaskImpl to handle the ConfigModify Activity block. Updates to the catalog migration scripts to include VNF-Config-Update Macro flow. Issue-ID: SO-2768 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I06be7a83fb2738b91b0257e1ec84298a7dafc1a1
Diffstat (limited to 'bpmn/so-bpmn-building-blocks/src')
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn67
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java54
2 files changed, 121 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn
new file mode 100644
index 0000000000..d77b1cebb1
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/Activity/VNFConfigModifyActivity.bpmn
@@ -0,0 +1,67 @@
+<?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.9.0">
+ <bpmn:process id="VNFConfigModifyActivity" name="VNFConfigModifyActivity" isExecutable="true">
+ <bpmn:startEvent id="Start_VNFConfigModifyActivity" name="Start">
+ <bpmn:outgoing>SequenceFlow_0d87xrn</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="ConfigModify" name="VNF Config Modify&#10;" camunda:type="external" camunda:topic="AppcService">
+ <bpmn:incoming>SequenceFlow_05oatn2</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1pg83wr</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0d87xrn" sourceRef="Start_VNFConfigModifyActivity" targetRef="PreProcessActivity" />
+ <bpmn:endEvent id="End_VNFConfigModifyActivity" name="End">
+ <bpmn:incoming>SequenceFlow_1pg83wr</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1pg83wr" sourceRef="ConfigModify" targetRef="End_VNFConfigModifyActivity" />
+ <bpmn:serviceTask id="PreProcessActivity" name="PreProcess Activity" camunda:expression="${AppcOrchestratorPreProcessor.buildAppcTaskRequest(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)),&#34;ConfigModify&#34;)}">
+ <bpmn:incoming>SequenceFlow_0d87xrn</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05oatn2</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05oatn2" sourceRef="PreProcessActivity" targetRef="ConfigModify" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="VNFConfigModifyActivity">
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="Start_VNFConfigModifyActivity">
+ <dc:Bounds x="173" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="179" y="138" width="25" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1q3bjtz_di" bpmnElement="ConfigModify">
+ <dc:Bounds x="532" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0d87xrn_di" bpmnElement="SequenceFlow_0d87xrn">
+ <di:waypoint xsi:type="dc:Point" x="209" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="257" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="257" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="304" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="272" y="114" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_15t8iwk_di" bpmnElement="End_VNFConfigModifyActivity">
+ <dc:Bounds x="756" y="102" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="764" y="142" width="20" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1pg83wr_di" bpmnElement="SequenceFlow_1pg83wr">
+ <di:waypoint xsi:type="dc:Point" x="632" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="756" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="694" y="99" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0h60lbz_di" bpmnElement="PreProcessActivity">
+ <dc:Bounds x="308" y="80" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_05oatn2_di" bpmnElement="SequenceFlow_05oatn2">
+ <di:waypoint xsi:type="dc:Point" x="408" y="120" />
+ <di:waypoint xsi:type="dc:Point" x="532" y="120" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="470" y="99" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java
new file mode 100644
index 0000000000..99ee8d9fcb
--- /dev/null
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFConfigModifyActivityTest.java
@@ -0,0 +1,54 @@
+/*-
+ * ============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.ArgumentMatchers.any;
+import static org.mockito.Mockito.doThrow;
+import java.util.List;
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.externaltask.LockedExternalTask;
+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 VNFConfigModifyActivityTest extends BaseBPMNTest {
+ @Test
+ public void sunnyDayVNFConfigModifyActivity_Test() throws InterruptedException {
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFConfigModifyActivity", variables);
+ assertThat(pi).isNotNull();
+ processExternalTasks(pi, "ConfigModify");
+ assertThat(pi).isStarted().hasPassedInOrder("Start_VNFConfigModifyActivity", "PreProcessActivity",
+ "ConfigModify", "End_VNFConfigModifyActivity");
+ assertThat(pi).isEnded();
+ }
+
+ @Test
+ public void rainyDayVNFConfigModifyActivity_Test() throws Exception {
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(appcOrchestratorPreProcessor)
+ .buildAppcTaskRequest(any(BuildingBlockExecution.class), any(String.class));
+ ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFConfigModifyActivity", variables);
+ assertThat(pi).isNotNull().isStarted().hasPassedInOrder("Start_VNFConfigModifyActivity", "PreProcessActivity")
+ .hasNotPassed("ConfigModify", "End_VNFConfigModifyActivity");
+ }
+
+}