aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java13
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/resources/subprocess/OpenstackAdapterTask.bpmn (renamed from bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn)170
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java112
4 files changed, 207 insertions, 90 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index e774899f74..01a0c3aeea 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -107,6 +107,7 @@ public class BBInputSetup implements JavaDelegate {
private static final String NETWORK_COLLECTION = "NetworkCollection";
private static final String PREPROV = "PREPROV";
private static final String CREATEVOLUME = "CreateVolume";
+ private static final String CONTROLLER = "Controller";
@Autowired
private BBInputSetupUtils bbInputSetupUtils;
@@ -1386,7 +1387,8 @@ public class BBInputSetup implements JavaDelegate {
cloudRegion = mapperLayer.mapCloudRegion(cloudConfiguration, aaiCloudRegion);
}
gBB.setCloudRegion(cloudRegion);
- if (bbName.contains(VNF)) {
+ if (bbName.contains(VNF) || (bbName.contains(CONTROLLER)
+ && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) {
for (GenericVnf genericVnf : serviceInstance.getVnfs()) {
if (lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID) != null
&& genericVnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
@@ -1398,7 +1400,8 @@ public class BBInputSetup implements JavaDelegate {
this.mapCatalogVnf(genericVnf, modelInfo, service);
}
}
- } else if (bbName.contains(VF_MODULE)) {
+ } else if (bbName.contains(VF_MODULE) || (bbName.contains(CONTROLLER)
+ && (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) {
for (GenericVnf vnf : serviceInstance.getVnfs()) {
for (VfModule vfModule : vnf.getVfModules()) {
if (lookupKeyMap.get(ResourceKey.VF_MODULE_ID) != null
@@ -1502,7 +1505,8 @@ public class BBInputSetup implements JavaDelegate {
BBInputSetupParameter parameter =
new BBInputSetupParameter.Builder().setRequestId(executeBB.getRequestId()).setService(service)
.setBbName(bbName).setServiceInstance(serviceInstance).setLookupKeyMap(lookupKeyMap).build();
- if (bbName.contains(VNF)) {
+ if (bbName.contains(VNF) || (bbName.contains(CONTROLLER)
+ && (VNF).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) {
vnfs = findVnfsByKey(key, resources, vnfs);
String vnfId = lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID);
// This stores the vnf id in request db to be retrieved later when
@@ -1530,7 +1534,8 @@ public class BBInputSetup implements JavaDelegate {
resources.getPnfs().stream()
.filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst()
.ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance));
- } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) {
+ } else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP) || (bbName.contains(CONTROLLER)
+ && (VF_MODULE).equalsIgnoreCase(executeBB.getBuildingBlock().getBpmnScope()))) {
Pair<Vnfs, VfModules> vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources);
if (vnfsAndVfModules != null) {
vfModules = vnfsAndVfModules.getValue1();
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
index 30fd2c8770..4455c9fe9d 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
@@ -329,7 +329,7 @@ public class ExceptionBuilder {
}
}
- public void processVnfAdapterException(DelegateExecution execution) {
+ public void processOpenstackAdapterException(DelegateExecution execution) {
StringBuilder workflowExceptionMessage = new StringBuilder();
logger.debug("Processing Vnf Adapter Exception");
try {
diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/OpenstackAdapterTask.bpmn
index 69b68e534e..e437f13d7b 100644
--- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn
+++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/OpenstackAdapterTask.bpmn
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_GraPIIyxEeWmdMDkx6Uftw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
- <bpmn2:process id="vnfAdapterTask" name="vnfAdapterTask" isExecutable="true">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_GraPIIyxEeWmdMDkx6Uftw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+ <bpmn2:process id="openstackAdapterTask" name="openstackAdapterTask" isExecutable="true">
<bpmn2:endEvent id="EndEvent_6">
<bpmn2:incoming>SequenceFlow_13uy51h</bpmn2:incoming>
</bpmn2:endEvent>
@@ -24,10 +24,10 @@
<bpmn2:outgoing>SequenceFlow_0o8wnkx</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:sequenceFlow id="SequenceFlow_13uy51h" name="Yes" sourceRef="ExclusiveGateway_1fn953y" targetRef="EndEvent_6">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackPollSuccess") == true }]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackPollSuccess") == true }</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_0o8wnkx" name="No" sourceRef="ExclusiveGateway_1fn953y" targetRef="EndEvent_1dt01ez">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackPollSuccess") == false }]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackPollSuccess") == false }</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:exclusiveGateway id="ExclusiveGateway_08a6you" name="Success?">
<bpmn2:incoming>SequenceFlow_1ff2y8j</bpmn2:incoming>
@@ -35,10 +35,10 @@
<bpmn2:outgoing>SequenceFlow_007m32h</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:sequenceFlow id="SequenceFlow_1p39f4r" name="Yes" sourceRef="ExclusiveGateway_08a6you" targetRef="ServiceTask_11iuzx9">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackInvokeSuccess") == true }]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackInvokeSuccess") == true }</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_007m32h" name="No" sourceRef="ExclusiveGateway_08a6you" targetRef="EndEvent_0rxprkw">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackInvokeSuccess") == false }]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("OpenstackInvokeSuccess") == false }</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:subProcess id="SubProcess_0y17e8j" name="Error Handling" triggeredByEvent="true">
<bpmn2:startEvent id="StartEvent_17oglfe">
@@ -48,7 +48,7 @@
<bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_040yoan">
<bpmn2:incoming>SequenceFlow_0y1by9x</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_006myq9</bpmn2:outgoing>
- <bpmn2:compensateEventDefinition waitForCompletion="true" activityRef="executeOpenstackAction" />
+ <bpmn2:compensateEventDefinition activityRef="executeOpenstackAction" />
</bpmn2:intermediateThrowEvent>
<bpmn2:exclusiveGateway id="ExclusiveGateway_0qlnby0" name="Poll Rollback Status?" default="SequenceFlow_1piwh1c">
<bpmn2:incoming>SequenceFlow_006myq9</bpmn2:incoming>
@@ -66,13 +66,13 @@
<bpmn2:incoming>SequenceFlow_1nku4uk</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1yx80cq</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
- <bpmn2:serviceTask id="buildError" name="&#10;Process&#10;Exception&#10;" camunda:expression="${ExceptionBuilder.processVnfAdapterException(execution)}">
+ <bpmn2:serviceTask id="buildError" name="&#10;Process&#10;Exception&#10;" camunda:expression="${ExceptionBuilder.processOpenstackAdapterException(execution)}">
<bpmn2:incoming>SequenceFlow_1yx80cq</bpmn2:incoming>
<bpmn2:incoming>SequenceFlow_1az3a2q</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0bnzfqb</bpmn2:outgoing>
</bpmn2:serviceTask>
<bpmn2:sequenceFlow id="SequenceFlow_1ubla93" name="Yes" sourceRef="ExclusiveGateway_0qlnby0" targetRef="ServiceTask_120p27h">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("PollRollbackStatus") == true}]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("PollRollbackStatus") == true}</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_1piwh1c" name="No" sourceRef="ExclusiveGateway_0qlnby0" targetRef="ExclusiveGateway_0tuxj9l" />
<bpmn2:sequenceFlow id="SequenceFlow_1nku4uk" sourceRef="ServiceTask_120p27h" targetRef="ExclusiveGateway_0tuxj9l" />
@@ -88,7 +88,7 @@
<bpmn2:outgoing>SequenceFlow_1az3a2q</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:sequenceFlow id="SequenceFlow_0y1by9x" name="Yes" sourceRef="ExclusiveGateway_18ndby1" targetRef="IntermediateThrowEvent_040yoan">
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("backout") == true }]]></bpmn2:conditionExpression>
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("backout") == true }</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_1az3a2q" name="No" sourceRef="ExclusiveGateway_18ndby1" targetRef="buildError" />
</bpmn2:subProcess>
@@ -109,226 +109,226 @@
<bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" />
<bpmn2:message id="Message_1" name="WorkflowMessage" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="vnfAdapterTask">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="openstackAdapterTask">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_54" bpmnElement="StartEvent_1">
- <dc:Bounds x="110" y="146" width="36" height="36" />
+ <dc:Bounds x="160" y="146" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="116" y="187" width="24" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_StartEvent_54" targetElement="ServiceTask_0rcy900_di">
- <di:waypoint xsi:type="dc:Point" x="146" y="164" />
- <di:waypoint xsi:type="dc:Point" x="253" y="163" />
+ <di:waypoint x="196" y="164" />
+ <di:waypoint x="303" y="163" />
<bpmndi:BPMNLabel>
<dc:Bounds x="154.5" y="145.5" width="90" height="6" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_158" bpmnElement="EndEvent_6">
- <dc:Bounds x="929" y="146" width="36" height="36" />
+ <dc:Bounds x="979" y="146" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="924" y="187" width="46" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0rcy900_di" bpmnElement="executeOpenstackAction">
- <dc:Bounds x="253" y="124" width="100" height="80" />
+ <dc:Bounds x="303" y="124" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1ff2y8j_di" bpmnElement="SequenceFlow_1ff2y8j">
- <di:waypoint xsi:type="dc:Point" x="353" y="164" />
- <di:waypoint xsi:type="dc:Point" x="404" y="164" />
+ <di:waypoint x="403" y="164" />
+ <di:waypoint x="454" y="164" />
<bpmndi:BPMNLabel>
<dc:Bounds x="333.5" y="139" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_11iuzx9_di" bpmnElement="ServiceTask_11iuzx9">
- <dc:Bounds x="541" y="124" width="100" height="80" />
+ <dc:Bounds x="591" y="124" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0ecut35_di" bpmnElement="SequenceFlow_0ecut35">
- <di:waypoint xsi:type="dc:Point" x="641" y="164" />
- <di:waypoint xsi:type="dc:Point" x="676" y="164" />
+ <di:waypoint x="691" y="164" />
+ <di:waypoint x="726" y="164" />
<bpmndi:BPMNLabel>
<dc:Bounds x="613.5" y="139" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_1fn953y_di" bpmnElement="ExclusiveGateway_1fn953y" isMarkerVisible="true">
- <dc:Bounds x="676" y="139" width="50" height="50" />
+ <dc:Bounds x="726" y="139" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="676" y="119" width="49" height="12" />
+ <dc:Bounds x="727" y="119" width="48" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13uy51h_di" bpmnElement="SequenceFlow_13uy51h">
- <di:waypoint xsi:type="dc:Point" x="726" y="164" />
- <di:waypoint xsi:type="dc:Point" x="929" y="164" />
+ <di:waypoint x="776" y="164" />
+ <di:waypoint x="979" y="164" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="746.6875" y="166" width="19" height="12" />
+ <dc:Bounds x="797" y="166" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0o8wnkx_di" bpmnElement="SequenceFlow_0o8wnkx">
- <di:waypoint xsi:type="dc:Point" x="701" y="189" />
- <di:waypoint xsi:type="dc:Point" x="701" y="249" />
+ <di:waypoint x="751" y="189" />
+ <di:waypoint x="751" y="249" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="706" y="198" width="14" height="12" />
+ <dc:Bounds x="756" y="198" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_120p27h_di" bpmnElement="ServiceTask_120p27h">
- <dc:Bounds x="496" y="443" width="100" height="80" />
+ <dc:Bounds x="546" y="443" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_08a6you_di" bpmnElement="ExclusiveGateway_08a6you" isMarkerVisible="true">
- <dc:Bounds x="404" y="139" width="50" height="50" />
+ <dc:Bounds x="454" y="139" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="409" y="117" width="49" height="12" />
+ <dc:Bounds x="460" y="117" width="48" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1p39f4r_di" bpmnElement="SequenceFlow_1p39f4r">
- <di:waypoint xsi:type="dc:Point" x="454" y="164" />
- <di:waypoint xsi:type="dc:Point" x="541" y="164" />
+ <di:waypoint x="504" y="164" />
+ <di:waypoint x="591" y="164" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="472" y="168" width="19" height="12" />
+ <dc:Bounds x="523" y="168" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_007m32h_di" bpmnElement="SequenceFlow_007m32h">
- <di:waypoint xsi:type="dc:Point" x="429" y="189" />
- <di:waypoint xsi:type="dc:Point" x="429" y="249" />
+ <di:waypoint x="479" y="189" />
+ <di:waypoint x="479" y="249" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="435" y="198" width="14" height="12" />
+ <dc:Bounds x="485" y="198" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_09bkjg0_di" bpmnElement="SubProcess_0y17e8j" isExpanded="true">
- <dc:Bounds x="151" y="404" width="787" height="344" />
+ <dc:Bounds x="201" y="404" width="787" height="344" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BoundaryEvent_04c5efr_di" bpmnElement="BoundaryEvent_1ysr7mk">
- <dc:Bounds x="335" y="186" width="36" height="36" />
+ <dc:Bounds x="385" y="186" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="353" y="226" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Association_1cnlu6p_di" bpmnElement="Association_1cnlu6p">
- <di:waypoint xsi:type="dc:Point" x="353" y="222" />
- <di:waypoint xsi:type="dc:Point" x="353" y="267" />
- <di:waypoint xsi:type="dc:Point" x="321" y="267" />
+ <di:waypoint x="403" y="222" />
+ <di:waypoint x="403" y="267" />
+ <di:waypoint x="371" y="267" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0vacscp_di" bpmnElement="Task_0zbd85n">
- <dc:Bounds x="221" y="227" width="100" height="80" />
+ <dc:Bounds x="271" y="227" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0lzcn0v_di" bpmnElement="EndEvent_0rxprkw">
- <dc:Bounds x="411" y="249" width="36" height="36" />
+ <dc:Bounds x="461" y="249" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="429" y="288.658" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_14424k5_di" bpmnElement="EndEvent_1dt01ez">
- <dc:Bounds x="683" y="249" width="36" height="36" />
+ <dc:Bounds x="733" y="249" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="701" y="288.658" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_1wrpebh_di" bpmnElement="StartEvent_17oglfe">
- <dc:Bounds x="181" y="599" width="36" height="36" />
+ <dc:Bounds x="231" y="599" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="198.35199999999998" y="638.658" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateThrowEvent_0gltuh4_di" bpmnElement="IntermediateThrowEvent_040yoan">
- <dc:Bounds x="365" y="529" width="36" height="36" />
+ <dc:Bounds x="415" y="529" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="382.352" y="569" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0qlnby0_di" bpmnElement="ExclusiveGateway_0qlnby0" isMarkerVisible="true">
- <dc:Bounds x="429.352" y="522" width="50" height="50" />
+ <dc:Bounds x="479" y="522" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="484" y="535" width="62" height="24" />
+ <dc:Bounds x="533" y="535" width="65" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_02rhau9_di" bpmnElement="SequenceFlow_02rhau9">
- <di:waypoint xsi:type="dc:Point" x="217" y="617" />
- <di:waypoint xsi:type="dc:Point" x="284" y="617" />
+ <di:waypoint x="267" y="617" />
+ <di:waypoint x="334" y="617" />
<bpmndi:BPMNLabel>
<dc:Bounds x="250.5" y="596" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_006myq9_di" bpmnElement="SequenceFlow_006myq9">
- <di:waypoint xsi:type="dc:Point" x="401" y="547" />
- <di:waypoint xsi:type="dc:Point" x="429" y="547" />
+ <di:waypoint x="451" y="547" />
+ <di:waypoint x="479" y="547" />
<bpmndi:BPMNLabel>
<dc:Bounds x="415" y="526" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0tuxj9l_di" bpmnElement="ExclusiveGateway_0tuxj9l" isMarkerVisible="true">
- <dc:Bounds x="608.352" y="522" width="50" height="50" />
+ <dc:Bounds x="658" y="522" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="633.352" y="576" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_108cgfw_di" bpmnElement="buildError">
- <dc:Bounds x="695" y="577" width="100" height="80" />
+ <dc:Bounds x="745" y="577" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1ubla93_di" bpmnElement="SequenceFlow_1ubla93">
- <di:waypoint xsi:type="dc:Point" x="454" y="522" />
- <di:waypoint xsi:type="dc:Point" x="454" y="483" />
- <di:waypoint xsi:type="dc:Point" x="496" y="483" />
+ <di:waypoint x="504" y="522" />
+ <di:waypoint x="504" y="483" />
+ <di:waypoint x="546" y="483" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="461" y="489" width="19" height="12" />
+ <dc:Bounds x="512" y="489" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1piwh1c_di" bpmnElement="SequenceFlow_1piwh1c">
- <di:waypoint xsi:type="dc:Point" x="454" y="572" />
- <di:waypoint xsi:type="dc:Point" x="454" y="603" />
- <di:waypoint xsi:type="dc:Point" x="633" y="603" />
- <di:waypoint xsi:type="dc:Point" x="633" y="572" />
+ <di:waypoint x="504" y="572" />
+ <di:waypoint x="504" y="603" />
+ <di:waypoint x="683" y="603" />
+ <di:waypoint x="683" y="572" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="460" y="576.85" width="14" height="12" />
+ <dc:Bounds x="510" y="577" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1nku4uk_di" bpmnElement="SequenceFlow_1nku4uk">
- <di:waypoint xsi:type="dc:Point" x="596" y="483" />
- <di:waypoint xsi:type="dc:Point" x="633" y="483" />
- <di:waypoint xsi:type="dc:Point" x="633" y="522" />
+ <di:waypoint x="646" y="483" />
+ <di:waypoint x="683" y="483" />
+ <di:waypoint x="683" y="522" />
<bpmndi:BPMNLabel>
<dc:Bounds x="614.5" y="462" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1yx80cq_di" bpmnElement="SequenceFlow_1yx80cq">
- <di:waypoint xsi:type="dc:Point" x="658" y="547" />
- <di:waypoint xsi:type="dc:Point" x="745" y="547" />
- <di:waypoint xsi:type="dc:Point" x="745" y="577" />
+ <di:waypoint x="708" y="547" />
+ <di:waypoint x="795" y="547" />
+ <di:waypoint x="795" y="577" />
<bpmndi:BPMNLabel>
<dc:Bounds x="656.5" y="526" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0bnzfqb_di" bpmnElement="SequenceFlow_0bnzfqb">
- <di:waypoint xsi:type="dc:Point" x="795" y="617" />
- <di:waypoint xsi:type="dc:Point" x="870" y="617" />
+ <di:waypoint x="845" y="617" />
+ <di:waypoint x="920" y="617" />
<bpmndi:BPMNLabel>
<dc:Bounds x="787.5" y="596" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1l1f6zj_di" bpmnElement="EndEvent_1yiy2fi">
- <dc:Bounds x="870" y="599" width="36" height="36" />
+ <dc:Bounds x="920" y="599" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="887.352" y="639" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_18ndby1_di" bpmnElement="ExclusiveGateway_18ndby1" isMarkerVisible="true">
- <dc:Bounds x="284.352" y="592" width="50" height="50" />
+ <dc:Bounds x="334" y="592" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="338" y="605" width="54" height="24" />
+ <dc:Bounds x="388" y="605" width="54" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0y1by9x_di" bpmnElement="SequenceFlow_0y1by9x">
- <di:waypoint xsi:type="dc:Point" x="309" y="592" />
- <di:waypoint xsi:type="dc:Point" x="309" y="547" />
- <di:waypoint xsi:type="dc:Point" x="365" y="547" />
+ <di:waypoint x="359" y="592" />
+ <di:waypoint x="359" y="547" />
+ <di:waypoint x="415" y="547" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="315" y="558" width="19" height="12" />
+ <dc:Bounds x="366" y="558" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1az3a2q_di" bpmnElement="SequenceFlow_1az3a2q">
- <di:waypoint xsi:type="dc:Point" x="309" y="642" />
- <di:waypoint xsi:type="dc:Point" x="309" y="686" />
- <di:waypoint xsi:type="dc:Point" x="745" y="686" />
- <di:waypoint xsi:type="dc:Point" x="745" y="657" />
+ <di:waypoint x="359" y="642" />
+ <di:waypoint x="359" y="686" />
+ <di:waypoint x="795" y="686" />
+ <di:waypoint x="795" y="657" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="318" y="657" width="14" height="12" />
+ <dc:Bounds x="368" y="657" width="15" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
index be9965b5b7..c730844aac 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java
@@ -2484,6 +2484,58 @@ public class BBInputSetupTest {
}
@Test
+ public void test_getGBBMacroNoUserParamsExistingService_forControllerExecutionBB() throws Exception {
+ // given
+ String requestAction = "unassignInstance";
+ GeneralBuildingBlock gBB = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"),
+ GeneralBuildingBlock.class);
+ L3Network network = new L3Network();
+ network.setNetworkId("networkId");
+ gBB.getServiceInstance().getNetworks().add(network);
+ ServiceInstance serviceInstance = gBB.getServiceInstance();
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ RequestDetails requestDetails = mapper
+ .readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceMacro.json"), RequestDetails.class);
+ requestDetails.getRequestParameters().setUserParams(null);
+ Map<ResourceKey, String> lookupKeyMap = prepareLookupKeyMap();
+ Service service = Mockito.mock(Service.class);
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setLcpCloudRegionId("cloudRegionId");
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+ org.onap.aai.domain.yang.L3Network aaiNetwork = new org.onap.aai.domain.yang.L3Network();
+ aaiNetwork.setModelCustomizationId("modelCustId");
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("vnfId");
+ gBB.getServiceInstance().getVnfs().add(vnf);
+ org.onap.aai.domain.yang.GenericVnf aaiVnf = new org.onap.aai.domain.yang.GenericVnf();
+ aaiVnf.setModelCustomizationId("modelCustId");
+
+ ConfigurationResourceKeys configResourceKeys = prepareConfigurationResourceKeys();
+ executeBB.setConfigurationResourceKeys(configResourceKeys).setRequestDetails(requestDetails);
+ BuildingBlock buildingBlock = executeBB.getBuildingBlock();
+ buildingBlock.setBpmnFlowName("ControllerExecutionBB").setKey("ab153b6e-c364-44c0-bef6-1f2982117f04");
+ buildingBlock.setBpmnScope("VNF");
+
+ aaiServiceInstance.setModelVersionId("modelVersionId");
+ doReturn(service).when(SPY_bbInputSetupUtils)
+ .getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+ doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils)
+ .getAAIServiceInstanceById(lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
+ doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
+ doReturn(gBB).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(any(BBInputSetupParameter.class));
+ doReturn(aaiVnf).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId());
+ doNothing().when(SPY_bbInputSetup).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class),
+ any(Service.class));
+ // when
+ SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap,
+ executeBB.getBuildingBlock().getBpmnFlowName(), requestAction, cloudConfiguration);
+ // then
+ verify(SPY_bbInputSetup, times(1)).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class),
+ any(Service.class));
+ }
+
+ @Test
public void test_getGBBMacroNoUserParamsExistingService_forActivateVnfBB() throws Exception {
// given
String requestAction = "unassignInstance";
@@ -2535,6 +2587,66 @@ public class BBInputSetupTest {
}
@Test
+ public void test_getGBBMacroNoUserParamsExistingService_forControllerExecutionBB_VFModule() throws Exception {
+ // given
+ String requestAction = "unassignInstance";
+ GeneralBuildingBlock gBB = mapper.readValue(new File(RESOURCE_PATH + "GeneralBuildingBlockExpected.json"),
+ GeneralBuildingBlock.class);
+ L3Network network = new L3Network();
+ network.setNetworkId("networkId");
+ gBB.getServiceInstance().getNetworks().add(network);
+ ServiceInstance serviceInstance = gBB.getServiceInstance();
+ ExecuteBuildingBlock executeBB = mapper.readValue(new File(RESOURCE_PATH + "ExecuteBuildingBlockSimple.json"),
+ ExecuteBuildingBlock.class);
+ RequestDetails requestDetails = mapper
+ .readValue(new File(RESOURCE_PATH + "RequestDetailsInput_serviceMacro.json"), RequestDetails.class);
+ requestDetails.getRequestParameters().setUserParams(null);
+ Map<ResourceKey, String> lookupKeyMap = prepareLookupKeyMap();
+ Service service = Mockito.mock(Service.class);
+ CloudConfiguration cloudConfiguration = new CloudConfiguration();
+ cloudConfiguration.setLcpCloudRegionId("cloudRegionId");
+ org.onap.aai.domain.yang.ServiceInstance aaiServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+ org.onap.aai.domain.yang.L3Network aaiNetwork = new org.onap.aai.domain.yang.L3Network();
+ aaiNetwork.setModelCustomizationId("modelCustId");
+ GenericVnf vnf = new GenericVnf();
+ vnf.setVnfId("vnfId");
+ gBB.getServiceInstance().getVnfs().add(vnf);
+ org.onap.aai.domain.yang.GenericVnf aaiVnf = new org.onap.aai.domain.yang.GenericVnf();
+ aaiVnf.setModelCustomizationId("modelCustId");
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("vfModuleId");
+ gBB.getServiceInstance().getVnfs().get(0).getVfModules().add(vfModule);
+ org.onap.aai.domain.yang.VfModule aaiVfModule = new org.onap.aai.domain.yang.VfModule();
+ aaiVfModule.setModelCustomizationId("modelCustId");
+
+ ConfigurationResourceKeys configResourceKeys = prepareConfigurationResourceKeys();
+ executeBB.setConfigurationResourceKeys(configResourceKeys).setRequestDetails(requestDetails);
+ BuildingBlock buildingBlock = executeBB.getBuildingBlock();
+ buildingBlock.setBpmnFlowName("ControllerExecutionBB").setKey("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f");
+ buildingBlock.setBpmnScope("VfModule");
+
+ aaiServiceInstance.setModelVersionId("modelVersionId");
+ doReturn(service).when(SPY_bbInputSetupUtils)
+ .getCatalogServiceByModelUUID(aaiServiceInstance.getModelVersionId());
+ doReturn(aaiServiceInstance).when(SPY_bbInputSetupUtils)
+ .getAAIServiceInstanceById(lookupKeyMap.get(ResourceKey.SERVICE_INSTANCE_ID));
+ doReturn(serviceInstance).when(SPY_bbInputSetup).getExistingServiceInstance(aaiServiceInstance);
+ doReturn(gBB).when(SPY_bbInputSetup).populateGBBWithSIAndAdditionalInfo(any(BBInputSetupParameter.class));
+ doReturn(aaiVnf).when(SPY_bbInputSetupUtils).getAAIGenericVnf(vnf.getVnfId());
+ doNothing().when(SPY_bbInputSetup).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class),
+ any(Service.class));
+ doReturn(aaiVfModule).when(SPY_bbInputSetupUtils).getAAIVfModule(vnf.getVnfId(), vfModule.getVfModuleId());
+ // when
+ SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap,
+ executeBB.getBuildingBlock().getBpmnFlowName(), requestAction, cloudConfiguration);
+ // then
+ verify(SPY_bbInputSetup, times(1)).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class),
+ any(Service.class));
+ verify(SPY_bbInputSetup, times(1)).mapCatalogVfModule(any(VfModule.class), any(ModelInfo.class),
+ any(Service.class), any(String.class));
+ }
+
+ @Test
public void test_getGBBMacroNoUserParamsExistingService_forUnassignVfModuleBB() throws Exception {
// given
String requestAction = "unassignInstance";