diff options
Diffstat (limited to 'bpmn')
19 files changed, 337 insertions, 730 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy index 644cf5e387..b457bdca46 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DoHandleOofRequest.groovy @@ -83,7 +83,7 @@ class DoHandleOofRequest extends AbstractServiceTaskProcessor { execution.setVariable("oofRequestPayload", requestJson) } - public void callOofAdapter(DelegateExecution execution) { + void callOofAdapter(DelegateExecution execution) { logger.debug("Start callOofAdapter") String requestId = execution.getVariable("msoRequestId") String oofAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.oof.endpoint", execution) @@ -95,7 +95,7 @@ class DoHandleOofRequest extends AbstractServiceTaskProcessor { Response httpResponse = httpClient.post(oofRequest) int responseCode = httpResponse.getStatus() logger.debug("OOF sync response code is: " + responseCode) - if(responseCode != 200){ + if(responseCode < 200 || responseCode >= 300){ exceptionUtil.buildAndThrowWorkflowException(execution, responseCode, "Received a Bad Sync Response from OOF.") } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy index 30cbeaf2d8..ff31c46a3a 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy @@ -540,10 +540,8 @@ class OofUtils { " \"timeout\": 600,\n" + " \"callbackUrl\": \"${callbackUrl}\"\n" + " },\n") - response.append(" \"serviceProfile\": {\n" + - " \"serviceProfileParameters\": ") - response.append(json); - response.append("\n }\n") + response.append(" \"serviceProfile\":") + response.append(json) response.append("\n}\n") return response.toString() } diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java index 62a2e9370e..57b8c1387d 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/Resource.java @@ -30,6 +30,7 @@ public abstract class Resource extends JsonWrapper implements Serializable { private static final long serialVersionUID = 1L; private String resourceId; // TODO name this field just id instead, should be the id of the object as it is in aai + private String originalResourceId; protected ResourceType resourceType; // Enum of vnf or network or allotted resource protected ModelInfo modelInfo; private long concurrencyCounter = 1L; @@ -52,6 +53,14 @@ public abstract class Resource extends JsonWrapper implements Serializable { this.resourceId = resourceId; } + public String getOriginalResourceId() { + return originalResourceId; + } + + public void setOriginalResourceId(String originalResourceId) { + this.originalResourceId = originalResourceId; + } + public ModelInfo getModelInfo() { return modelInfo; } diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn index 01caf38610..383fd27b56 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ActivateVfModuleBB.bpmn @@ -2,14 +2,13 @@ <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="3.7.0"> <bpmn:process id="ActivateVfModuleBB" name="ActivateVfModuleBB" isExecutable="true"> <bpmn:startEvent id="ActivateVfModuleBB_Start"> - <bpmn:outgoing>SequenceFlow_0ieafii</bpmn:outgoing> + <bpmn:outgoing>Flow_1hz7ga1</bpmn:outgoing> </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_0ieafii" sourceRef="ActivateVfModuleBB_Start" targetRef="CheckAuditVariable" /> <bpmn:endEvent id="ActivateVfModuleBB_End"> <bpmn:incoming>SequenceFlow_0xsp0pv</bpmn:incoming> </bpmn:endEvent> <bpmn:serviceTask id="ActivateVfModule" name=" SDNC Activate (vf module) " camunda:expression="${SDNCActivateTasks.activateVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_1b63lv4</bpmn:incoming> + <bpmn:incoming>Flow_1hz7ga1</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1a495wm</bpmn:outgoing> </bpmn:serviceTask> <bpmn:serviceTask id="UpdateVfModuleActiveStatus" name=" AAI Update (vf module) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusActivateVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> @@ -29,64 +28,7 @@ </bpmn:callActivity> <bpmn:sequenceFlow id="SequenceFlow_1a495wm" sourceRef="ActivateVfModule" targetRef="CallActivity_sdncHandler" /> <bpmn:sequenceFlow id="SequenceFlow_1j4x1ej" sourceRef="CallActivity_sdncHandler" targetRef="UpdateVfModuleActiveStatus" /> - <bpmn:sequenceFlow id="SequenceFlow_0xndboi" sourceRef="Setup_AAI_Inventory_Audit" targetRef="Audit_AAI_Inventory" /> - <bpmn:serviceTask id="Setup_AAI_Inventory_Audit" name="Setup Inventory Audit Variable" camunda:expression="${AuditTasks.setupAuditVariable(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_0ghzwlo</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0xndboi</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="Audit_AAI_Inventory" name="Validate A&AI Inventory" camunda:type="external" camunda:topic="InventoryAddAudit"> - <bpmn:incoming>SequenceFlow_0xndboi</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0l8684g</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_07ybdik" name="No" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="ExclusiveGateway_0sqvzll" /> - <bpmn:sequenceFlow id="SequenceFlow_0ghzwlo" name="Yes" sourceRef="ExclusiveGateway_1v8bmbu" targetRef="Setup_AAI_Inventory_Audit"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditInventoryNeeded") == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="CheckAuditVariable" name="Check Audit Variable" camunda:expression="${AuditTasks.isAuditNeeded(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_0ieafii</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1xqyur9</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_1xqyur9" sourceRef="CheckAuditVariable" targetRef="ExclusiveGateway_1v8bmbu" /> - <bpmn:sequenceFlow id="SequenceFlow_1b63lv4" sourceRef="ExclusiveGateway_0sqvzll" targetRef="ActivateVfModule" /> - <bpmn:subProcess id="SubProcess_0bpsptg" name="Audit Exception Sub Process" triggeredByEvent="true"> - <bpmn:startEvent id="catchInventoryException"> - <bpmn:outgoing>SequenceFlow_19gbhlj</bpmn:outgoing> - <bpmn:errorEventDefinition errorRef="Error_1s3kxze" /> - </bpmn:startEvent> - <bpmn:endEvent id="EndEvent_067jv1n"> - <bpmn:incoming>SequenceFlow_0l4jzc5</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_19gbhlj" sourceRef="catchInventoryException" targetRef="processAuditException" /> - <bpmn:sequenceFlow id="SequenceFlow_0l4jzc5" sourceRef="processAuditException" targetRef="EndEvent_067jv1n" /> - <bpmn:serviceTask id="processAuditException" name="Proccess Error" camunda:expression="${ExceptionBuilder.processAuditException(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")), false)}"> - <bpmn:incoming>SequenceFlow_19gbhlj</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0l4jzc5</bpmn:outgoing> - </bpmn:serviceTask> - </bpmn:subProcess> - <bpmn:inclusiveGateway id="ExclusiveGateway_1v8bmbu" name="Audit Enabled?" default="SequenceFlow_07ybdik"> - <bpmn:incoming>SequenceFlow_1xqyur9</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_07ybdik</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0ghzwlo</bpmn:outgoing> - </bpmn:inclusiveGateway> - <bpmn:inclusiveGateway id="ExclusiveGateway_0sqvzll"> - <bpmn:incoming>SequenceFlow_07ybdik</bpmn:incoming> - <bpmn:incoming>Flow_1c5mrjc</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1b63lv4</bpmn:outgoing> - </bpmn:inclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0l8684g" sourceRef="Audit_AAI_Inventory" targetRef="Gateway_1518atw" /> - <bpmn:exclusiveGateway id="Gateway_1518atw" name="Audit Failed?" default="Flow_1c5mrjc"> - <bpmn:incoming>SequenceFlow_0l8684g</bpmn:incoming> - <bpmn:outgoing>Flow_1c5mrjc</bpmn:outgoing> - <bpmn:outgoing>Flow_02xnvmz</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="Flow_1c5mrjc" sourceRef="Gateway_1518atw" targetRef="ExclusiveGateway_0sqvzll" /> - <bpmn:sequenceFlow id="Flow_02xnvmz" sourceRef="Gateway_1518atw" targetRef="Event_1ubxkat"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditIsSuccessful") == false}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:endEvent id="Event_1ubxkat"> - <bpmn:incoming>Flow_02xnvmz</bpmn:incoming> - <bpmn:errorEventDefinition id="ErrorEventDefinition_0qq1s4r" errorRef="Error_1s3kxze" /> - </bpmn:endEvent> + <bpmn:sequenceFlow id="Flow_1hz7ga1" sourceRef="ActivateVfModuleBB_Start" targetRef="ActivateVfModule" /> </bpmn:process> <bpmn:error id="Error_0q258vt" errorCode="7000" /> <bpmn:error id="Error_0zgccif" name="org.onap.so.adapters.inventory.create.InventoryException" errorCode="org.onap.so.adapters.inventory.create.InventoryException" /> @@ -94,167 +36,51 @@ <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ActivateVfModuleBB"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="ActivateVfModuleBB_Start"> - <dc:Bounds x="156" y="260" width="36" height="36" /> + <dc:Bounds x="156" y="100" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="58" y="270" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0ieafii_di" bpmnElement="SequenceFlow_0ieafii"> - <di:waypoint x="192" y="278" /> - <di:waypoint x="272" y="278" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="116" y="231" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_1v967li_di" bpmnElement="ActivateVfModuleBB_End"> - <dc:Bounds x="1475" y="261" width="36" height="36" /> + <dc:Bounds x="736" y="101" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1235" y="275" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0hawa84_di" bpmnElement="ActivateVfModule"> - <dc:Bounds x="1029" y="238" width="100" height="80" /> + <dc:Bounds x="290" y="78" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_175e9ul_di" bpmnElement="UpdateVfModuleActiveStatus"> - <dc:Bounds x="1285" y="238" width="100" height="80" /> + <dc:Bounds x="546" y="78" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0xsp0pv_di" bpmnElement="SequenceFlow_0xsp0pv"> - <di:waypoint x="1385" y="278" /> - <di:waypoint x="1475" y="279" /> + <di:waypoint x="646" y="118" /> + <di:waypoint x="736" y="119" /> <bpmndi:BPMNLabel> <dc:Bounds x="1314" y="231.5" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_03jkesd_di" bpmnElement="CallActivity_sdncHandler"> - <dc:Bounds x="1157" y="238" width="100" height="80" /> + <dc:Bounds x="418" y="78" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1a495wm_di" bpmnElement="SequenceFlow_1a495wm"> - <di:waypoint x="1129" y="278" /> - <di:waypoint x="1157" y="278" /> + <di:waypoint x="390" y="118" /> + <di:waypoint x="418" y="118" /> <bpmndi:BPMNLabel> <dc:Bounds x="1027" y="231" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1j4x1ej_di" bpmnElement="SequenceFlow_1j4x1ej"> - <di:waypoint x="1257" y="278" /> - <di:waypoint x="1285" y="278" /> + <di:waypoint x="518" y="118" /> + <di:waypoint x="546" y="118" /> <bpmndi:BPMNLabel> <dc:Bounds x="1155" y="231" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0xndboi_di" bpmnElement="SequenceFlow_0xndboi"> - <di:waypoint x="589" y="201" /> - <di:waypoint x="630" y="201" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="457" y="153.5" width="90" height="13" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0krf1ur_di" bpmnElement="Setup_AAI_Inventory_Audit"> - <dc:Bounds x="489" y="161" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_08rxjeb_di" bpmnElement="Audit_AAI_Inventory"> - <dc:Bounds x="630" y="161" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_07ybdik_di" bpmnElement="SequenceFlow_07ybdik"> - <di:waypoint x="426" y="303" /> - <di:waypoint x="426" y="341" /> - <di:waypoint x="952" y="341" /> - <di:waypoint x="952" y="303" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="435" y="320" width="15" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0ghzwlo_di" bpmnElement="SequenceFlow_0ghzwlo"> - <di:waypoint x="426" y="253" /> - <di:waypoint x="426" y="201" /> - <di:waypoint x="489" y="201" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="434" y="211" width="18" height="14" /> - </bpmndi:BPMNLabel> + <bpmndi:BPMNEdge id="Flow_1hz7ga1_di" bpmnElement="Flow_1hz7ga1"> + <di:waypoint x="192" y="118" /> + <di:waypoint x="290" y="118" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1eg5ryx_di" bpmnElement="CheckAuditVariable"> - <dc:Bounds x="272" y="238" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1xqyur9_di" bpmnElement="SequenceFlow_1xqyur9"> - <di:waypoint x="372" y="278" /> - <di:waypoint x="401" y="278" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="270.5" y="230.5" width="90" height="13" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1b63lv4_di" bpmnElement="SequenceFlow_1b63lv4"> - <di:waypoint x="977" y="278" /> - <di:waypoint x="1029" y="278" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="887" y="231" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_0mbkb7v_di" bpmnElement="SubProcess_0bpsptg" isExpanded="true"> - <dc:Bounds x="364" y="475" width="350" height="200" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_12r96di_di" bpmnElement="catchInventoryException"> - <dc:Bounds x="395" y="558" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="341.15269461077844" y="571.6127744510978" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_067jv1n_di" bpmnElement="EndEvent_067jv1n"> - <dc:Bounds x="643" y="558" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="590.1526946107784" y="572" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_19gbhlj_di" bpmnElement="SequenceFlow_19gbhlj"> - <di:waypoint x="431" y="576" /> - <di:waypoint x="486" y="576" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="387.5" y="529" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0l4jzc5_di" bpmnElement="SequenceFlow_0l4jzc5"> - <di:waypoint x="586" y="576" /> - <di:waypoint x="643" y="576" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="543.5" y="529" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_08xffml_di" bpmnElement="processAuditException"> - <dc:Bounds x="486" y="536" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="InclusiveGateway_03pi9y4_di" bpmnElement="ExclusiveGateway_1v8bmbu"> - <dc:Bounds x="401" y="253" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="454" y="272" width="74" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="InclusiveGateway_16ap4e3_di" bpmnElement="ExclusiveGateway_0sqvzll"> - <dc:Bounds x="927" y="253" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="836" y="281" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0l8684g_di" bpmnElement="SequenceFlow_0l8684g"> - <di:waypoint x="730" y="201" /> - <di:waypoint x="785" y="201" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="Gateway_1518atw_di" bpmnElement="Gateway_1518atw" isMarkerVisible="true"> - <dc:Bounds x="785" y="176" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="780" y="233" width="64" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Flow_1c5mrjc_di" bpmnElement="Flow_1c5mrjc"> - <di:waypoint x="835" y="201" /> - <di:waypoint x="952" y="201" /> - <di:waypoint x="952" y="253" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_02xnvmz_di" bpmnElement="Flow_02xnvmz"> - <di:waypoint x="810" y="176" /> - <di:waypoint x="810" y="118" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="Event_133vsyh_di" bpmnElement="Event_1ubxkat"> - <dc:Bounds x="792" y="82" width="36" height="36" /> - </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn index 87e0b883a9..9a33a3e4bf 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn @@ -1,11 +1,11 @@ <?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="3.1.2"> +<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="3.7.0"> <bpmn:process id="DeleteVfModuleBB" name="DeleteVfModuleBB" isExecutable="true"> <bpmn:startEvent id="DeleteVfModuleBB_Start"> - <bpmn:outgoing>SequenceFlow_1oeootm</bpmn:outgoing> + <bpmn:outgoing>Flow_02lmh6f</bpmn:outgoing> </bpmn:startEvent> <bpmn:serviceTask id="DeleteVfModuleVnfAdapter" name="Prepare Request" camunda:expression="${VnfAdapterDeleteTasks.deleteVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_028rmiu</bpmn:incoming> + <bpmn:incoming>Flow_02lmh6f</bpmn:incoming> <bpmn:outgoing>SequenceFlow_08tvhtf</bpmn:outgoing> </bpmn:serviceTask> <bpmn:serviceTask id="UpdateVfModuleDeleteStatus" name=" AAI Update (vf module) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusDeleteVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> @@ -29,9 +29,8 @@ <camunda:out source="contrailServiceInstanceFqdn" target="contrailServiceInstanceFqdn" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_08tvhtf</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_02lpx87</bpmn:outgoing> + <bpmn:outgoing>Flow_0hlvlw2</bpmn:outgoing> </bpmn:callActivity> - <bpmn:sequenceFlow id="SequenceFlow_02lpx87" sourceRef="VnfAdapter" targetRef="ExclusiveGateway_1yvh16a" /> <bpmn:subProcess id="SubProcess_11p7mrh" name="Error Handling " triggeredByEvent="true"> <bpmn:startEvent id="StartEvent_1xp6ewt"> <bpmn:outgoing>SequenceFlow_0h607z0</bpmn:outgoing> @@ -51,7 +50,7 @@ <bpmn:sequenceFlow id="SequenceFlow_09l7pcg" sourceRef="UpdateVfModuleDeleteStatus" targetRef="DeleteVfModuleBB_End" /> <bpmn:sequenceFlow id="SequenceFlow_0xyu3pk" sourceRef="DeleteNetworkPolicies" targetRef="UpdateVnfIpv4OamAddress" /> <bpmn:serviceTask id="DeleteNetworkPolicies" name=" AAI Delete (net policies) " camunda:expression="${AAIDeleteTasks.deleteNetworkPolicies(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_0sy2nky</bpmn:incoming> + <bpmn:incoming>Flow_0n2pqrr</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0xyu3pk</bpmn:outgoing> </bpmn:serviceTask> <bpmn:serviceTask id="UpdateVnfManagementV6Address" name=" AAI Update (vnf) " camunda:expression="${AAIUpdateTasks.updateManagementV6AddressVnf(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> @@ -69,496 +68,176 @@ <bpmn:incoming>SequenceFlow_0khqfnc</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0yuz21z</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_032jv5j" name="Yes " sourceRef="auditEnabledCheck" targetRef="Setup_Audit_Variable"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditInventoryNeeded") == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_14bu4ys" sourceRef="ExclusiveGateway_1yvh16a" targetRef="ServiceTask_08ulmzc" /> - <bpmn:serviceTask id="Check_Audit" name="Check Audit Variable" camunda:expression="${AuditTasks.isDeleteAuditNeeded(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_1oeootm</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_10af0fk</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="Audit_Inventory" name=" AAI Audit (vservers) " camunda:type="external" camunda:topic="InventoryDeleteAudit"> - <bpmn:incoming>SequenceFlow_0f5ljoh</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0hpj2mm</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="Setup_Audit_Variable" name="Setup Audit Variable" camunda:expression="${AuditTasks.setupAuditVariable(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_032jv5j</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1iulltd</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:subProcess id="SubProcess_0grvkj2" name="Audit Exception Sub Process" triggeredByEvent="true"> - <bpmn:endEvent id="EndEvent_1gzq57j"> - <bpmn:incoming>SequenceFlow_1fhst92</bpmn:incoming> - </bpmn:endEvent> - <bpmn:serviceTask id="ServiceTask_1isbxvo" name="Proccess Error" camunda:expression="${ExceptionBuilder.processAuditException(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")), true)}"> - <bpmn:incoming>SequenceFlow_0xuodpy</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1fhst92</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_0xuodpy" sourceRef="StartEvent_1euiddy" targetRef="ServiceTask_1isbxvo" /> - <bpmn:sequenceFlow id="SequenceFlow_1fhst92" sourceRef="ServiceTask_1isbxvo" targetRef="EndEvent_1gzq57j" /> - <bpmn:startEvent id="StartEvent_1euiddy" isInterrupting="false"> - <bpmn:outgoing>SequenceFlow_0xuodpy</bpmn:outgoing> - <bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" camunda:escalationCodeVariable="auditCode" /> - </bpmn:startEvent> - </bpmn:subProcess> - <bpmn:sequenceFlow id="SequenceFlow_179btn2" sourceRef="aaiCatch" targetRef="ServiceTask_0itw3by" /> <bpmn:intermediateThrowEvent id="aaiThrow" name="Update AAI"> - <bpmn:incoming>SequenceFlow_1i9ft2r</bpmn:incoming> + <bpmn:incoming>Flow_0plbl7p</bpmn:incoming> <bpmn:linkEventDefinition name="AAI" /> </bpmn:intermediateThrowEvent> <bpmn:intermediateCatchEvent id="aaiCatch" name="Update AAI"> - <bpmn:outgoing>SequenceFlow_179btn2</bpmn:outgoing> + <bpmn:outgoing>Flow_0n2pqrr</bpmn:outgoing> <bpmn:linkEventDefinition name="AAI" /> </bpmn:intermediateCatchEvent> - <bpmn:sequenceFlow id="SequenceFlow_17cd9e2" name="Yes/No" sourceRef="auditSuccessfulCheck" targetRef="ExclusiveGateway_01wvywu"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditIsSuccessful") == false || execution.getVariable("auditIsSuccessful") == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1gdyk9j" name="No" sourceRef="auditSuccessfulCheck" targetRef="EndEvent_0b0ocu0"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditIsSuccessful") == false}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:inclusiveGateway id="auditSuccessfulCheck" name="Audit Successful?"> - <bpmn:incoming>SequenceFlow_0hpj2mm</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_17cd9e2</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1gdyk9j</bpmn:outgoing> - </bpmn:inclusiveGateway> - <bpmn:endEvent id="EndEvent_0b0ocu0"> - <bpmn:incoming>SequenceFlow_1gdyk9j</bpmn:incoming> - <bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" /> - </bpmn:endEvent> - <bpmn:exclusiveGateway id="auditEnabledCheck" name="Audit Enabled?" default="SequenceFlow_1bt1p2u"> - <bpmn:incoming>SequenceFlow_10af0fk</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_032jv5j</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1bt1p2u</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:exclusiveGateway id="ExclusiveGateway_1t9q2jl"> - <bpmn:incoming>SequenceFlow_1bt1p2u</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0dzf7hz</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1bq9g02</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1bt1p2u" name="No" sourceRef="auditEnabledCheck" targetRef="ExclusiveGateway_1t9q2jl" /> - <bpmn:sequenceFlow id="SequenceFlow_1oeootm" sourceRef="DeleteVfModuleBB_Start" targetRef="Check_Audit" /> - <bpmn:sequenceFlow id="SequenceFlow_10af0fk" sourceRef="Check_Audit" targetRef="auditEnabledCheck" /> - <bpmn:serviceTask id="aicQueryStack" name=" AIC Query (stack) " camunda:type="external" camunda:topic="InventoryQueryAudit"> - <bpmn:incoming>SequenceFlow_1iulltd</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0dzf7hz</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_1iulltd" sourceRef="Setup_Audit_Variable" targetRef="aicQueryStack" /> - <bpmn:sequenceFlow id="SequenceFlow_0dzf7hz" sourceRef="aicQueryStack" targetRef="ExclusiveGateway_1t9q2jl" /> - <bpmn:sequenceFlow id="SequenceFlow_1bq9g02" sourceRef="ExclusiveGateway_1t9q2jl" targetRef="ExclusiveGateway_1naduhl" /> - <bpmn:sequenceFlow id="SequenceFlow_0mtzl4z" sourceRef="ExclusiveGateway_1naduhl" targetRef="ExclusiveGateway_13fhmpf" /> - <bpmn:sequenceFlow id="SequenceFlow_028rmiu" sourceRef="ExclusiveGateway_1naduhl" targetRef="DeleteVfModuleVnfAdapter" /> - <bpmn:parallelGateway id="ExclusiveGateway_1naduhl"> - <bpmn:incoming>SequenceFlow_1bq9g02</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0mtzl4z</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_028rmiu</bpmn:outgoing> - </bpmn:parallelGateway> - <bpmn:inclusiveGateway id="ExclusiveGateway_1yvh16a"> - <bpmn:incoming>SequenceFlow_02lpx87</bpmn:incoming> - <bpmn:incoming>SequenceFlow_13mlz57</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_14bu4ys</bpmn:outgoing> - </bpmn:inclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0hpj2mm" sourceRef="Audit_Inventory" targetRef="auditSuccessfulCheck" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_13fhmpf" name="Audit Enabled?" default="SequenceFlow_1gjwivp"> - <bpmn:incoming>SequenceFlow_0mtzl4z</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0f5ljoh</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1gjwivp</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0f5ljoh" name="Yes" sourceRef="ExclusiveGateway_13fhmpf" targetRef="Audit_Inventory"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("auditInventoryNeeded") == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:exclusiveGateway id="ExclusiveGateway_01wvywu"> - <bpmn:incoming>SequenceFlow_17cd9e2</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1gjwivp</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_13mlz57</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1gjwivp" name="No" sourceRef="ExclusiveGateway_13fhmpf" targetRef="ExclusiveGateway_01wvywu" /> - <bpmn:sequenceFlow id="SequenceFlow_13mlz57" sourceRef="ExclusiveGateway_01wvywu" targetRef="ExclusiveGateway_1yvh16a" /> <bpmn:serviceTask id="ServiceTask_0itw3by" name=" AAI Delete (inventory) " camunda:type="external" camunda:topic="InventoryDelete"> - <bpmn:incoming>SequenceFlow_179btn2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0sy2nky</bpmn:outgoing> + <bpmn:incoming>SequenceFlow_1i9ft2r</bpmn:incoming> + <bpmn:outgoing>Flow_0plbl7p</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_0sy2nky" sourceRef="ServiceTask_0itw3by" targetRef="DeleteNetworkPolicies" /> <bpmn:serviceTask id="ServiceTask_08ulmzc" name=" Create Cloud Variable " camunda:expression="${DeleteVFModule.createInventoryVariable(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_14bu4ys</bpmn:incoming> + <bpmn:incoming>Flow_0hlvlw2</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1i9ft2r</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_1i9ft2r" sourceRef="ServiceTask_08ulmzc" targetRef="aaiThrow" /> + <bpmn:sequenceFlow id="SequenceFlow_1i9ft2r" sourceRef="ServiceTask_08ulmzc" targetRef="ServiceTask_0itw3by" /> + <bpmn:sequenceFlow id="Flow_0n2pqrr" sourceRef="aaiCatch" targetRef="DeleteNetworkPolicies" /> + <bpmn:sequenceFlow id="Flow_0plbl7p" sourceRef="ServiceTask_0itw3by" targetRef="aaiThrow" /> + <bpmn:sequenceFlow id="Flow_0hlvlw2" sourceRef="VnfAdapter" targetRef="ServiceTask_08ulmzc" /> + <bpmn:sequenceFlow id="Flow_02lmh6f" sourceRef="DeleteVfModuleBB_Start" targetRef="DeleteVfModuleVnfAdapter" /> </bpmn:process> <bpmn:error id="Error_0jjnve8" name="Error_3k24na6" errorCode="AAIInventoryFailure" /> <bpmn:escalation id="Escalation_130je8j" name="audit" escalationCode="audit1" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteVfModuleBB"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DeleteVfModuleBB_Start"> - <dc:Bounds x="159" y="266" width="36" height="36" /> + <dc:Bounds x="159" y="106" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="132" y="302" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_16798zf_di" bpmnElement="DeleteVfModuleVnfAdapter"> - <dc:Bounds x="888" y="312" width="100" height="80" /> + <dc:Bounds x="290" y="84" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0pbhsub_di" bpmnElement="UpdateVfModuleDeleteStatus"> - <dc:Bounds x="1136" y="468" width="100" height="80" /> + <dc:Bounds x="930" y="308" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_08tvhtf_di" bpmnElement="SequenceFlow_08tvhtf"> - <di:waypoint x="988" y="352" /> - <di:waypoint x="1020" y="352" /> + <di:waypoint x="390" y="124" /> + <di:waypoint x="435" y="124" /> <bpmndi:BPMNLabel> <dc:Bounds x="959" y="331" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_1rn6yvh_di" bpmnElement="DeleteVfModuleBB_End"> - <dc:Bounds x="1268" y="490" width="36" height="36" /> + <dc:Bounds x="1142" y="330" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="1241" y="530" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0whogn3_di" bpmnElement="VnfAdapter"> - <dc:Bounds x="1020" y="312" width="100" height="80" /> + <dc:Bounds x="435" y="84" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_02lpx87_di" bpmnElement="SequenceFlow_02lpx87"> - <di:waypoint x="1120" y="352" /> - <di:waypoint x="1203" y="352" /> - <di:waypoint x="1203" y="309" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1116.5" y="337" width="90" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="SubProcess_11p7mrh_di" bpmnElement="SubProcess_11p7mrh" isExpanded="true"> - <dc:Bounds x="290" y="878" width="231" height="135" /> + <dc:Bounds x="304" y="500" width="231" height="135" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_1xp6ewt_di" bpmnElement="StartEvent_1xp6ewt"> - <dc:Bounds x="333" y="940" width="36" height="36" /> + <dc:Bounds x="347" y="562" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="261" y="976" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0guhjau_di" bpmnElement="EndEvent_0guhjau"> - <dc:Bounds x="462" y="940" width="36" height="36" /> + <dc:Bounds x="476" y="562" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="390" y="976" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0h607z0_di" bpmnElement="SequenceFlow_0h607z0"> - <di:waypoint x="369" y="958" /> - <di:waypoint x="462" y="958" /> + <di:waypoint x="383" y="580" /> + <di:waypoint x="476" y="580" /> <bpmndi:BPMNLabel> <dc:Bounds x="371" y="937" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0vlgqod_di" bpmnElement="UpdateVfModuleHeatStackId"> - <dc:Bounds x="969" y="468" width="100" height="80" /> + <dc:Bounds x="800" y="308" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_01vfwtp_di" bpmnElement="SequenceFlow_01vfwtp"> - <di:waypoint x="1069" y="508" /> - <di:waypoint x="1136" y="508" /> + <di:waypoint x="900" y="348" /> + <di:waypoint x="930" y="348" /> <bpmndi:BPMNLabel> <dc:Bounds x="848" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_09l7pcg_di" bpmnElement="SequenceFlow_09l7pcg"> - <di:waypoint x="1236" y="508" /> - <di:waypoint x="1268" y="508" /> + <di:waypoint x="1030" y="348" /> + <di:waypoint x="1142" y="348" /> <bpmndi:BPMNLabel> <dc:Bounds x="1092.5" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0xyu3pk_di" bpmnElement="SequenceFlow_0xyu3pk"> - <di:waypoint x="420" y="468" /> - <di:waypoint x="420" y="448" /> - <di:waypoint x="443" y="409" /> - <di:waypoint x="497" y="468" /> + <di:waypoint x="370" y="348" /> + <di:waypoint x="400" y="348" /> <bpmndi:BPMNLabel> <dc:Bounds x="345" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0tty0ac_di" bpmnElement="DeleteNetworkPolicies"> - <dc:Bounds x="370" y="468" width="100" height="80" /> + <dc:Bounds x="270" y="308" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0lrrd16_di" bpmnElement="UpdateVnfManagementV6Address"> - <dc:Bounds x="642" y="468" width="100" height="80" /> + <dc:Bounds x="540" y="308" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0jtem3b_di" bpmnElement="SequenceFlow_0jtem3b"> - <di:waypoint x="533" y="468" /> - <di:waypoint x="533" y="448" /> - <di:waypoint x="619" y="387" /> - <di:waypoint x="692" y="448" /> - <di:waypoint x="692" y="468" /> + <di:waypoint x="500" y="348" /> + <di:waypoint x="540" y="348" /> <bpmndi:BPMNLabel> <dc:Bounds x="473" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0w9805b_di" bpmnElement="UpdateVnfIpv4OamAddress"> - <dc:Bounds x="483" y="468" width="100" height="80" /> + <dc:Bounds x="400" y="308" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0khqfnc_di" bpmnElement="SequenceFlow_0khqfnc"> - <di:waypoint x="742" y="493" /> - <di:waypoint x="891" y="448" /> - <di:waypoint x="891" y="468" /> + <di:waypoint x="640" y="348" /> + <di:waypoint x="670" y="348" /> <bpmndi:BPMNLabel> <dc:Bounds x="598" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0yuz21z_di" bpmnElement="SequenceFlow_0yuz21z"> - <di:waypoint x="941" y="508" /> - <di:waypoint x="969" y="508" /> + <di:waypoint x="770" y="348" /> + <di:waypoint x="800" y="348" /> <bpmndi:BPMNLabel> <dc:Bounds x="722" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0v8naz9_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn"> - <dc:Bounds x="841" y="468" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_032jv5j_di" bpmnElement="SequenceFlow_032jv5j"> - <di:waypoint x="397" y="259" /> - <di:waypoint x="397" y="214" /> - <di:waypoint x="444" y="214" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="405.5348837209302" y="217.95121951219514" width="19" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_14bu4ys_di" bpmnElement="SequenceFlow_14bu4ys"> - <di:waypoint x="1228" y="284" /> - <di:waypoint x="1284" y="284" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1230.5" y="262.5" width="90" height="13" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1vmz3zo_di" bpmnElement="Check_Audit"> - <dc:Bounds x="244" y="244" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1l8r2a6_di" bpmnElement="Audit_Inventory"> - <dc:Bounds x="930" y="117" width="100" height="80" /> + <dc:Bounds x="670" y="308" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1gttdjr_di" bpmnElement="Setup_Audit_Variable"> - <dc:Bounds x="444" y="174" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="SubProcess_0grvkj2_di" bpmnElement="SubProcess_0grvkj2" isExpanded="true"> - <dc:Bounds x="231" y="642" width="350" height="200" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1gzq57j_di" bpmnElement="EndEvent_1gzq57j"> - <dc:Bounds x="510" y="725" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="438" y="765" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1isbxvo_di" bpmnElement="ServiceTask_1isbxvo"> - <dc:Bounds x="353" y="703" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0xuodpy_di" bpmnElement="SequenceFlow_0xuodpy"> - <di:waypoint x="298" y="743" /> - <di:waypoint x="353" y="743" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="280.5" y="722" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1fhst92_di" bpmnElement="SequenceFlow_1fhst92"> - <di:waypoint x="453" y="743" /> - <di:waypoint x="510" y="743" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="393" y="722" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_179btn2_di" bpmnElement="SequenceFlow_179btn2"> - <di:waypoint x="195" y="508" /> - <di:waypoint x="225" y="508" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="191" y="487" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="IntermediateThrowEvent_1sftyjz_di" bpmnElement="aaiThrow"> - <dc:Bounds x="1481" y="266" width="36" height="36" /> + <dc:Bounds x="1062" y="106" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1472" y="305" width="57" height="14" /> + <dc:Bounds x="1053" y="145" width="57" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateCatchEvent_13y483m_di" bpmnElement="aaiCatch"> - <dc:Bounds x="159" y="490" width="36" height="36" /> + <dc:Bounds x="159" y="330" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="150" y="530" width="55" height="12" /> + <dc:Bounds x="149" y="370" width="57" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_17cd9e2_di" bpmnElement="SequenceFlow_17cd9e2"> - <di:waypoint x="1108" y="157" /> - <di:waypoint x="1156" y="157" /> - <di:waypoint x="1156" y="189" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1111.0434782608695" y="137" width="36" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1gdyk9j_di" bpmnElement="SequenceFlow_1gdyk9j"> - <di:waypoint x="1083" y="132" /> - <di:waypoint x="1083" y="109" /> - <di:waypoint x="1083" y="109" /> - <di:waypoint x="1083" y="84" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1083" y="110.74468085106383" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="InclusiveGateway_0i6rdd1_di" bpmnElement="auditSuccessfulCheck"> - <dc:Bounds x="1058" y="132" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1053" y="186" width="60" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_04qhoba_di" bpmnElement="StartEvent_1euiddy"> - <dc:Bounds x="262" y="725" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="189" y="765" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1onxfk1_di" bpmnElement="EndEvent_0b0ocu0"> - <dc:Bounds x="1065" y="48" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1024" y="87" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_05scr6c_di" bpmnElement="auditEnabledCheck" isMarkerVisible="true"> - <dc:Bounds x="371.6051332675222" y="259" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="421" y="272" width="45" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1t9q2jl_di" bpmnElement="ExclusiveGateway_1t9q2jl" isMarkerVisible="true"> - <dc:Bounds x="697" y="259" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="677" y="313" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1bt1p2u_di" bpmnElement="SequenceFlow_1bt1p2u"> - <di:waypoint x="397" y="309" /> - <di:waypoint x="397" y="352" /> - <di:waypoint x="722" y="352" /> - <di:waypoint x="722" y="309" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="407" y="326" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1oeootm_di" bpmnElement="SequenceFlow_1oeootm"> - <di:waypoint x="195" y="284" /> - <di:waypoint x="244" y="284" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="219.5" y="263" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_10af0fk_di" bpmnElement="SequenceFlow_10af0fk"> - <di:waypoint x="344" y="284" /> - <di:waypoint x="372" y="284" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="358" y="263" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1l7z1c0_di" bpmnElement="aicQueryStack"> - <dc:Bounds x="571" y="174" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1iulltd_di" bpmnElement="SequenceFlow_1iulltd"> - <di:waypoint x="544" y="214" /> - <di:waypoint x="571" y="214" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="557.5" y="193" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0dzf7hz_di" bpmnElement="SequenceFlow_0dzf7hz"> - <di:waypoint x="671" y="214" /> - <di:waypoint x="722" y="214" /> - <di:waypoint x="722" y="259" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="651.5" y="193" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1bq9g02_di" bpmnElement="SequenceFlow_1bq9g02"> - <di:waypoint x="747" y="284" /> - <di:waypoint x="796" y="284" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="726.5" y="263" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0mtzl4z_di" bpmnElement="SequenceFlow_0mtzl4z"> - <di:waypoint x="821" y="259" /> - <di:waypoint x="821" y="214" /> - <di:waypoint x="846" y="214" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="791" y="231" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_028rmiu_di" bpmnElement="SequenceFlow_028rmiu"> - <di:waypoint x="821" y="309" /> - <di:waypoint x="821" y="352" /> - <di:waypoint x="888" y="352" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="791" y="324.5" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ParallelGateway_1we1ooj_di" bpmnElement="ExclusiveGateway_1naduhl"> - <dc:Bounds x="796" y="259" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="775" y="313" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="InclusiveGateway_07wvmp4_di" bpmnElement="ExclusiveGateway_1yvh16a"> - <dc:Bounds x="1178" y="259" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1067" y="312" width="90" height="12" /> - </bpmndi:BPMNLabel> + <bpmndi:BPMNShape id="ServiceTask_0itw3by_di" bpmnElement="ServiceTask_0itw3by"> + <dc:Bounds x="740" y="84" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0hpj2mm_di" bpmnElement="SequenceFlow_0hpj2mm"> - <di:waypoint x="1030" y="157" /> - <di:waypoint x="1058" y="157" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="999" y="136" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_13fhmpf_di" bpmnElement="ExclusiveGateway_13fhmpf" isMarkerVisible="true"> - <dc:Bounds x="846" y="189" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="898" y="202" width="45" height="24" /> - </bpmndi:BPMNLabel> + <bpmndi:BPMNShape id="ServiceTask_08ulmzc_di" bpmnElement="ServiceTask_08ulmzc"> + <dc:Bounds x="590" y="84" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0f5ljoh_di" bpmnElement="SequenceFlow_0f5ljoh"> - <di:waypoint x="871" y="189" /> - <di:waypoint x="871" y="157" /> - <di:waypoint x="930" y="157" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="877.601615925754" y="162.89580806038546" width="19" height="12" /> - </bpmndi:BPMNLabel> + <bpmndi:BPMNEdge id="SequenceFlow_1i9ft2r_di" bpmnElement="SequenceFlow_1i9ft2r"> + <di:waypoint x="690" y="124" /> + <di:waypoint x="740" y="124" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_01wvywu_di" bpmnElement="ExclusiveGateway_01wvywu" isMarkerVisible="true"> - <dc:Bounds x="1131" y="189" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1111" y="243" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1gjwivp_di" bpmnElement="SequenceFlow_1gjwivp"> - <di:waypoint x="871" y="239" /> - <di:waypoint x="871" y="266" /> - <di:waypoint x="1156" y="266" /> - <di:waypoint x="1156" y="239" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="879" y="244" width="14" height="12" /> - </bpmndi:BPMNLabel> + <bpmndi:BPMNEdge id="Flow_0n2pqrr_di" bpmnElement="Flow_0n2pqrr"> + <di:waypoint x="195" y="348" /> + <di:waypoint x="270" y="348" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_13mlz57_di" bpmnElement="SequenceFlow_13mlz57"> - <di:waypoint x="1181" y="214" /> - <di:waypoint x="1203" y="214" /> - <di:waypoint x="1203" y="259" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1147" y="193" width="90" height="12" /> - </bpmndi:BPMNLabel> + <bpmndi:BPMNEdge id="Flow_0plbl7p_di" bpmnElement="Flow_0plbl7p"> + <di:waypoint x="840" y="124" /> + <di:waypoint x="1062" y="124" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0itw3by_di" bpmnElement="ServiceTask_0itw3by"> - <dc:Bounds x="225" y="468" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0sy2nky_di" bpmnElement="SequenceFlow_0sy2nky"> - <di:waypoint x="325" y="508" /> - <di:waypoint x="370" y="508" /> + <bpmndi:BPMNEdge id="Flow_0hlvlw2_di" bpmnElement="Flow_0hlvlw2"> + <di:waypoint x="535" y="124" /> + <di:waypoint x="590" y="124" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_08ulmzc_di" bpmnElement="ServiceTask_08ulmzc"> - <dc:Bounds x="1284" y="244" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1i9ft2r_di" bpmnElement="SequenceFlow_1i9ft2r"> - <di:waypoint x="1384" y="276" /> - <di:waypoint x="1433" y="276" /> - <di:waypoint x="1433" y="284" /> - <di:waypoint x="1481" y="284" /> + <bpmndi:BPMNEdge id="Flow_02lmh6f_di" bpmnElement="Flow_02lmh6f"> + <di:waypoint x="195" y="124" /> + <di:waypoint x="290" y="124" /> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java index 6f89f3c738..558e785e94 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/ActivateVfModuleBBTest.java @@ -22,12 +22,9 @@ 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.doReturn; import static org.mockito.Mockito.doThrow; import java.io.IOException; -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.Before; import org.junit.Test; @@ -47,20 +44,10 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest { public void sunnyDay() throws InterruptedException, IOException { mockSubprocess("SDNCHandler", "My Mock Process Name", "GenericStub"); ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); - List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryAddAudit", 60L * 1000L).execute(); - while (!tasks.isEmpty()) { - for (LockedExternalTask task : tasks) { - externalTaskService.complete(task.getId(), "externalWorkerId"); - } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L) - .execute(); - } assertThat(pi).isNotNull(); - assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", - "Setup_AAI_Inventory_Audit", "Audit_AAI_Inventory", "ActivateVfModule", "CallActivity_sdncHandler", - "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End"); + assertThat(pi).isStarted().hasPassedInOrder("ActivateVfModuleBB_Start", "ActivateVfModule", + "CallActivity_sdncHandler", "UpdateVfModuleActiveStatus", "ActivateVfModuleBB_End"); assertThat(pi).isEnded(); } @@ -70,19 +57,9 @@ public class ActivateVfModuleBBTest extends BaseBPMNTest { doThrow(BpmnError.class).when(aaiUpdateTasks) .updateOrchestrationStatusActivateVfModule(any(BuildingBlockExecution.class)); ProcessInstance pi = runtimeService.startProcessInstanceByKey("ActivateVfModuleBB", variables); - List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId") - .topic("InventoryAddAudit", 60L * 1000L).execute(); - while (!tasks.isEmpty()) { - for (LockedExternalTask task : tasks) { - externalTaskService.complete(task.getId(), "externalWorkerId"); - } - tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryAddAudit", 60L * 1000L) - .execute(); - } assertThat(pi).isNotNull().isStarted() - .hasPassedInOrder("ActivateVfModuleBB_Start", "ExclusiveGateway_1v8bmbu", "Setup_AAI_Inventory_Audit", - "Audit_AAI_Inventory", "ActivateVfModule", "UpdateVfModuleActiveStatus") + .hasPassedInOrder("ActivateVfModuleBB_Start", "ActivateVfModule", "UpdateVfModuleActiveStatus") .hasNotPassed("ActivateVfModuleBB_End"); } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy index 72fd052f31..5f0d412de0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy @@ -21,6 +21,7 @@ package org.onap.so.bpmn.infrastructure.scripts import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder +import org.onap.so.serviceinstancebeans.Service import static org.apache.commons.lang3.StringUtils.* import org.camunda.bpm.engine.delegate.BpmnError @@ -126,21 +127,22 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { logger.debug("modelInfo: " + serviceModelInfo) - //requestParameters - String subscriptionServiceType = jsonUtil.getJsonValue(ssRequest, "requestDetails.requestParameters.subscriptionServiceType") - if (isBlank(subscriptionServiceType)) { - msg = "Input subscriptionServiceType is null" - logger.debug(msg) - exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) - } else { - execution.setVariable("subscriptionServiceType", subscriptionServiceType) - } - logger.debug("subscriptionServiceType: " + subscriptionServiceType) +// //requestParameters +// String subscriptionServiceType = jsonUtil.getJsonValue(ssRequest, "requestDetails.requestParameters.subscriptionServiceType") +// if (isBlank(subscriptionServiceType)) { +// msg = "Input subscriptionServiceType is null" +// logger.debug(msg) +// exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) +// } else { +// subscriptionServiceType = "5G" +// execution.setVariable("subscriptionServiceType", subscriptionServiceType) +// } +// logger.debug("subscriptionServiceType: " + subscriptionServiceType) /* * Extracting User Parameters from incoming Request and converting into a Map */ - Map reqMap = jsonSlurper.parseText(ssRequest) + Map reqMap = jsonSlurper.parseText(ssRequest) as Map //InputParams def userParamsList = reqMap.requestDetails?.requestParameters?.userParams @@ -168,6 +170,7 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { execution.setVariable("serviceInputParams", inputMap) execution.setVariable("uuiRequest", uuiRequest) execution.setVariable("serviceProfile", serviceProfile) + execution.setVariable("subscriptionServiceType", serviceObject.get("serviceType")) //TODO //execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy index 48e1acd523..fc80a9f658 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy @@ -101,6 +101,9 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ */ String serviceRole = "service-profile" String serviceType = execution.getVariable("serviceType") + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") + Map<String, Object> serviceProfile = sliceParams.getServiceProfile() String ssInstanceId = execution.getVariable("serviceInstanceId") try { @@ -121,7 +124,10 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ ss.setEnvironmentContext(snssai) ss.setServiceRole(serviceRole) - AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(ssInstanceId)) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(ssInstanceId)) client.create(uri, ss) } catch (BpmnError e) { throw e @@ -139,8 +145,8 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ //rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString()) rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true") rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", ssInstanceId) - rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", execution.getVariable("subscriptionServiceType")) - rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", execution.getVariable("globalSubscriberId")) + rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", subscriptionServiceType) + rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", globalSubscriberId) execution.setVariable("rollbackData", rollbackData) execution.setVariable("RollbackData", rollbackData) logger.debug("RollbackData:" + rollbackData) @@ -156,6 +162,8 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ /** * todo: ServiceProfile params changed */ + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") SliceTaskParamsAdapter sliceParams = execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter Map<String, Object> serviceProfileMap = sliceParams.getServiceProfile() @@ -181,11 +189,11 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ serviceProfile.setSurvivalTime("0") serviceProfile.setReliability("") try { - AAIResourceUri uri = AAIUriFactory.createResourceUri( - AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")) - .serviceSubscription(execution.getVariable("subscriptionServiceType")) - .serviceInstance(serviceProfileInstanceId) - .serviceProfile(serviceProfileId)) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(serviceProfileInstanceId) + .serviceProfile(serviceProfileId)) client.create(uri, serviceProfile) execution.setVariable("sliceTaskParams", sliceParams) @@ -206,15 +214,21 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ public void createAllottedResource(DelegateExecution execution) { try { - + String globalSubscriberId = execution.getVariable("globalSubscriberId") + String subscriptionServiceType = execution.getVariable("subscriptionServiceType") ServiceDecomposition serviceDecomposition = execution.getVariable("serviceProfileDecomposition") as ServiceDecomposition + String serviceInstanceId = execution.getVariable("serviceInstanceId") List<org.onap.so.bpmn.core.domain.AllottedResource> allottedResourceList = serviceDecomposition.getAllottedResources() for(org.onap.so.bpmn.core.domain.AllottedResource allottedResource : allottedResourceList) { String allottedResourceId = UUID.randomUUID().toString() - AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(execution.getVariable("serviceInstanceId")).allottedResource(allottedResourceId)) + AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(globalSubscriberId) + .serviceSubscription(subscriptionServiceType) + .serviceInstance(serviceInstanceId) + .allottedResource(allottedResourceId)) execution.setVariable("allottedResourceUri", allottedResourceUri) String arType = allottedResource.getAllottedResourceType() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy index 1d5232f3c5..cfdbe98c34 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy @@ -371,6 +371,9 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ execution.setVariable("needQuerySliceProfile", true) } else { + if(execution.getVariable("needQuerySliceProfile")){ + execution.setVariable("needQuerySliceProfile", false) + } processNewNSI(solution, sliceTaskParams) } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy index 7beafefc28..f20bca9837 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy @@ -22,6 +22,7 @@ package org.onap.so.bpmn.infrastructure.scripts import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.NetworkPolicy import org.onap.aai.domain.yang.SliceProfile import org.onap.aaiclient.client.aai.AAIResourcesClient import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri @@ -133,7 +134,7 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { throw e } catch (Exception ex) { String msg = "Exception in DoCreateTnNssiInstance.createServiceInstance: " + ex.getMessage() - logger.info(msg) + logger.error(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } } @@ -163,6 +164,8 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { resource.setAllottedResourceName("network_" + execution.getVariable("sliceServiceInstanceName")) getAAIClient().create(allottedResourceUri, resource) + createNetworkPolicyForAllocatedResource(execution, ssInstanceId, allottedResourceId) + String linkArrayStr = jsonUtil.getJsonValue(networkStr, "connectionLinks") createLogicalLinksForAllocatedResource(execution, linkArrayStr, ssInstanceId, allottedResourceId) } @@ -170,7 +173,81 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { throw e } catch (Exception ex) { String msg = "Exception in DoCreateTnNssiInstance.createAllottedResource: " + ex.getMessage() - logger.info(msg) + logger.error(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + void createNetworkPolicy(DelegateExecution execution, String ssInstanceId, String networkPolicyId) { + try { + + String sliceProfileStr = execution.getVariable("sliceProfile") + if (sliceProfileStr == null || sliceProfileStr.isEmpty()) { + String msg = "ERROR: createNetworkPolicy: sliceProfile is null" + logger.error(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + NetworkPolicy networkPolicy = new NetworkPolicy(); + networkPolicy.setNetworkPolicyId(networkPolicyId) + networkPolicy.setName("TSCi policy") + networkPolicy.setType("SLA") + networkPolicy.setNetworkPolicyFqdn(ssInstanceId) + + String latencyStr = jsonUtil.getJsonValue(sliceProfileStr, "latency") + if (latencyStr != null && !latencyStr.isEmpty()) { + networkPolicy.setLatency(Integer.parseInt(latencyStr)) + } + + String bwStr = jsonUtil.getJsonValue(sliceProfileStr, "maxBandwidth") + if (bwStr != null && !bwStr.isEmpty()) { + networkPolicy.setMaxBandwidth(Integer.parseInt(bwStr)) + } else { + log.debug("ERROR: createNetworkPolicy: maxBandwidth is null") + } + + //networkPolicy.setReliability(new Object()) + + AAIResourceUri networkPolicyUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().networkPolicy(networkPolicyId)) + getAAIClient().create(networkPolicyUri, networkPolicy) + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoCreateSliceServiceInstance.instantiateSliceService. " + ex.getMessage() + logger.error(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + void createNetworkPolicyForAllocatedResource(DelegateExecution execution, + String ssInstanceId, + String allottedResourceId) { + try { + AAIResourceUri allottedResourceUri = + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(execution.getVariable("globalSubscriberId")) + .serviceSubscription(execution.getVariable("subscriptionServiceType")) + .serviceInstance(ssInstanceId) + .allottedResource(allottedResourceId)) + + if (!getAAIClient().exists(allottedResourceUri)) { + logger.info("ERROR: createLogicalLinksForAllocatedResource: allottedResource not exist: uri={}", + allottedResourceUri) + return + } + + String networkPolicyId = UUID.randomUUID().toString() + createNetworkPolicy(execution, ssInstanceId, networkPolicyId) + + tnNssmfUtils.attachNetworkPolicyToAllottedResource(execution, AAI_VERSION, allottedResourceUri, networkPolicyId); + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoCreateSliceServiceInstance.instantiateSliceService. " + ex.getMessage() + logger.error(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } } @@ -219,7 +296,7 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { throw e } catch (Exception ex) { String msg = "Exception in DoCreateTnNssiInstance.createLogicalLinksForAllocatedResource: " + ex.getMessage() - logger.info(msg) + logger.error(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateNSSI.groovy index 75ef7d347c..f3bc47e7cf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateNSSI.groovy @@ -151,6 +151,7 @@ class DoDeallocateNSSI extends AbstractServiceTaskProcessor serviceInfo.setServiceInvariantUuid(serviceInvariantUuid) serviceInfo.setServiceUuid(serviceUuid) serviceInfo.setNsiId(nsiId) + serviceInfo.setNssiId(nssiId) serviceInfo.setGlobalSubscriberId(globalSubscriberId) serviceInfo.setSubscriptionServiceType(subscriptionServiceType) String serviceInfoString = objectMapper.writeValueAsString(serviceInfo) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy index e856522fca..8a276ed330 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy @@ -321,7 +321,8 @@ class TnAllocateNssi extends AbstractServiceTaskProcessor { String status, String progress, String statusDescription) { - String serviceId = execution.getVariable("sliceServiceInstanceId") + String serviceId = execution.getVariable("dummyServiceId") + String ssInstanceId = execution.getVariable("sliceServiceInstanceId") String jobId = execution.getVariable("jobId") String nsiId = execution.getVariable("nsiId") @@ -329,6 +330,7 @@ class TnAllocateNssi extends AbstractServiceTaskProcessor { roStatus.setServiceId(serviceId) roStatus.setOperationId(jobId) roStatus.setResourceTemplateUUID(nsiId) + roStatus.setResourceInstanceID(ssInstanceId) roStatus.setOperType("Allocate") roStatus.setProgress(progress) roStatus.setStatus(status) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy index 869b55b5d2..d97f416db9 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy @@ -118,55 +118,67 @@ class TnNssmfUtils { if (execution.getVariable("vnfParamsExistFlag") == true) { sdncVNFParamsXml = buildSDNCParamsXml(execution) } else { - sdncVNFParamsXml = "" + sdncVNFParamsXml = buildDefaultVnfInputParams(vnfId) } String sdncRequest = - """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1" - xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1" - xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>${MsoUtils.xmlEscape(uuid)}</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>${MsoUtils.xmlEscape(svcAction)}</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <sdncadapterworkflow:SDNCRequestData> - <request-information> - <request-id>${MsoUtils.xmlEscape(requestId)}</request-id> - <request-action>${MsoUtils.xmlEscape(reqAction)}</request-action> - <source>${MsoUtils.xmlEscape(source)}</source> - <notification-url/> - <order-number/> - <order-version/> - </request-information> - <service-information> - <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> - <subscription-service-type>${MsoUtils.xmlEscape(subServiceType)}</subscription-service-type> - ${serviceEcompModelInformation} - <service-instance-id>${MsoUtils.xmlEscape(svcInstId)}</service-instance-id> - <global-customer-id>${MsoUtils.xmlEscape(globalSubscriberId)}</global-customer-id> - </service-information> - <vnf-information> - <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id> - <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> - ${vnfEcompModelInformation} - </vnf-information> - <vnf-request-input> - ${vnfNameString} - <tenant>${MsoUtils.xmlEscape(tenantId)}</tenant> - <aic-cloud-region>${MsoUtils.xmlEscape(cloudSiteId)}</aic-cloud-region> - ${sdncVNFParamsXml} - </vnf-request-input> - </sdncadapterworkflow:SDNCRequestData> - </sdncadapterworkflow:SDNCAdapterWorkflowRequest>""" + """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1" + xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1" + xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1"> + <sdncadapter:RequestHeader> + <sdncadapter:RequestId>${MsoUtils.xmlEscape(uuid)}</sdncadapter:RequestId> + <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId> + <sdncadapter:SvcAction>${MsoUtils.xmlEscape(svcAction)}</sdncadapter:SvcAction> + <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation> + <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl> + <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> + </sdncadapter:RequestHeader> + <sdncadapterworkflow:SDNCRequestData> + <request-information> + <request-id>${MsoUtils.xmlEscape(requestId)}</request-id> + <request-action>${MsoUtils.xmlEscape(reqAction)}</request-action> + <source>${MsoUtils.xmlEscape(source)}</source> + <notification-url/> + <order-number/> + <order-version/> + </request-information> + <service-information> + <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> + <subscription-service-type>${MsoUtils.xmlEscape(subServiceType)}</subscription-service-type> + ${serviceEcompModelInformation} + <service-instance-id>${MsoUtils.xmlEscape(svcInstId)}</service-instance-id> + <global-customer-id>${MsoUtils.xmlEscape(globalSubscriberId)}</global-customer-id> + </service-information> + <vnf-information> + <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id> + <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> + ${vnfEcompModelInformation} + </vnf-information> + <vnf-request-input> + ${vnfNameString} + <tenant>${MsoUtils.xmlEscape(tenantId)}</tenant> + <aic-cloud-region>${MsoUtils.xmlEscape(cloudSiteId)}</aic-cloud-region> + ${sdncVNFParamsXml} + </vnf-request-input> + </sdncadapterworkflow:SDNCRequestData> + </sdncadapterworkflow:SDNCAdapterWorkflowRequest>""" logger.debug("sdncRequest: " + sdncRequest) return sdncRequest } + + String buildDefaultVnfInputParams(String vnfName) { + String res = + """<vnf-input-parameters> + <param> + <name>${MsoUtils.xmlEscape(vnfName)}</name> + </param> + </vnf-input-parameters>""" + + return res + } + String buildSDNCParamsXml(DelegateExecution execution) { String params = "" StringBuilder sb = new StringBuilder() @@ -241,19 +253,19 @@ class TnNssmfUtils { } String getExecutionInputParams(DelegateExecution execution) { - String res = "msoRequestId=" + execution.getVariable("msoRequestId") + - ", modelInvariantUuid=" + execution.getVariable("modelInvariantUuid") + - ", modelUuid=" + execution.getVariable("modelUuid") + - ", serviceInstanceID=" + execution.getVariable("serviceInstanceID") + - ", operationType=" + execution.getVariable("operationType") + - ", globalSubscriberId=" + execution.getVariable("globalSubscriberId") + - ", dummyServiceId=" + execution.getVariable("dummyServiceId") + - ", nsiId=" + execution.getVariable("nsiId") + - ", networkType=" + execution.getVariable("networkType") + - ", subscriptionServiceType=" + execution.getVariable("subscriptionServiceType") + - ", jobId=" + execution.getVariable("jobId") + - ", sliceParams=" + execution.getVariable("sliceParams") + - ", servicename=" + execution.getVariable("servicename") + String res = "\n msoRequestId=" + execution.getVariable("msoRequestId") + + "\n modelInvariantUuid=" + execution.getVariable("modelInvariantUuid") + + "\n modelUuid=" + execution.getVariable("modelUuid") + + "\n serviceInstanceID=" + execution.getVariable("serviceInstanceID") + + "\n operationType=" + execution.getVariable("operationType") + + "\n globalSubscriberId=" + execution.getVariable("globalSubscriberId") + + "\n dummyServiceId=" + execution.getVariable("dummyServiceId") + + "\n nsiId=" + execution.getVariable("nsiId") + + "\n networkType=" + execution.getVariable("networkType") + + "\n subscriptionServiceType=" + execution.getVariable("subscriptionServiceType") + + "\n jobId=" + execution.getVariable("jobId") + + "\n sliceParams=" + execution.getVariable("sliceParams") + + "\n servicename=" + execution.getVariable("servicename") return res } @@ -297,7 +309,6 @@ class TnNssmfUtils { void attachLogicalLinkToAllottedResource(DelegateExecution execution, String aaiVersion, AAIResourceUri arUri, String logicalLinkId) { - String toLink = "aai/${aaiVersion}/network/logical-links/logical-link/${logicalLinkId}" Relationship relationship = new Relationship() @@ -307,4 +318,18 @@ class TnNssmfUtils { createRelationShipInAAI(execution, arUri, relationship) } + + void attachNetworkPolicyToAllottedResource(DelegateExecution execution, String aaiVersion, + AAIResourceUri aaiResourceUri, String networkPolicyId) { + + String toLink = "aai/${aaiVersion}/network/network-policies/network-policy/${networkPolicyId}" + + Relationship relationship = new Relationship() + relationship.setRelatedLink(toLink) + relationship.setRelatedTo("network-policy") + relationship.setRelationshipLabel("org.onap.relationships.inventory.Uses") + + createRelationShipInAAI(execution, aaiResourceUri, relationship) + + } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceInstance.bpmn index 2aa7da2cd2..f2d4d7c701 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateSliceServiceInstance.bpmn @@ -44,7 +44,7 @@ dcsi.createAllottedResource(execution)</bpmn:script> <bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1wafqwa</bpmn:outgoing> <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* -def dcsi= new CreateSliceService() +def dcsi = new DoCreateSliceServiceInstance() dcsi.prepareDecomposeService(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:callActivity id="CallActivity_0svmkxh" name="Call Decompose Service" calledElement="DecomposeService"> @@ -135,4 +135,4 @@ dcsi.prepareDecomposeService(execution)</bpmn:script> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> -</bpmn:definitions>
\ No newline at end of file +</bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn index 55adbe3698..fefa022bb9 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn @@ -21,9 +21,9 @@ def dcsi = new DoCreateTnNssiInstance() dcsi.createServiceInstance(execution)</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_1uiz85h" sourceRef="Activity_16luyg1" targetRef="Event_1rsf7yb" /> - <bpmn:sequenceFlow id="SequenceFlow_0g5bwvl" sourceRef="instantiate_NSTask" targetRef="Activity_08tw2di" /> + <bpmn:sequenceFlow id="SequenceFlow_0g5bwvl" sourceRef="instantiate_NSTask" targetRef="ScriptTask_18rzwzb" /> <bpmn:scriptTask id="ScriptTask_18rzwzb" name="Create Allottedsource in AAI" scriptFormat="groovy"> - <bpmn:incoming>Flow_106ei42</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0g5bwvl</bpmn:incoming> <bpmn:outgoing>SequenceFlow_17u69c4</bpmn:outgoing> <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateTnNssiInstance() @@ -74,14 +74,6 @@ dcsi.validateSDNCResponse(execution, response, "allocate")</bpmn:script> <bpmn:incoming>SequenceFlow_17u69c4</bpmn:incoming> <bpmn:linkEventDefinition id="LinkEventDefinition_1skl6p7" name="SdncOperation" /> </bpmn:intermediateThrowEvent> - <bpmn:scriptTask id="Activity_08tw2di" name="create Slice Profile in AAI" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_0g5bwvl</bpmn:incoming> - <bpmn:outgoing>Flow_106ei42</bpmn:outgoing> - <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* -def dcsi = new DoCreateTnNssiInstance() -dcsi.createSliceProfile(execution)</bpmn:script> - </bpmn:scriptTask> - <bpmn:sequenceFlow id="Flow_106ei42" sourceRef="Activity_08tw2di" targetRef="ScriptTask_18rzwzb" /> </bpmn:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateTnNssiInstance"> @@ -98,12 +90,12 @@ dcsi.createSliceProfile(execution)</bpmn:script> <di:waypoint x="299" y="375" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_17u69c4_di" bpmnElement="SequenceFlow_17u69c4"> - <di:waypoint x="930" y="129" /> - <di:waypoint x="1102" y="129" /> + <di:waypoint x="830" y="129" /> + <di:waypoint x="982" y="129" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0g5bwvl_di" bpmnElement="SequenceFlow_0g5bwvl"> - <di:waypoint x="574" y="129" /> - <di:waypoint x="650" y="129" /> + <di:waypoint x="600" y="129" /> + <di:waypoint x="730" y="129" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1uiz85h_di" bpmnElement="SequenceFlow_1uiz85h"> <di:waypoint x="840" y="375" /> @@ -113,37 +105,25 @@ dcsi.createSliceProfile(execution)</bpmn:script> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova"> - <di:waypoint x="393" y="129" /> - <di:waypoint x="474" y="129" /> + <di:waypoint x="410" y="129" /> + <di:waypoint x="500" y="129" /> <bpmndi:BPMNLabel> <dc:Bounds x="436" y="108" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln"> <di:waypoint x="211" y="129" /> - <di:waypoint x="251" y="129" /> - <di:waypoint x="251" y="129" /> - <di:waypoint x="293" y="129" /> + <di:waypoint x="310" y="129" /> <bpmndi:BPMNLabel> <dc:Bounds x="266" y="123" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_106ei42_di" bpmnElement="Flow_106ei42"> - <di:waypoint x="750" y="129" /> - <di:waypoint x="830" y="129" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="allocateTnNssi_StartEvent"> <dc:Bounds x="175" y="111" width="36" height="36" /> <bpmndi:BPMNLabel> <dc:Bounds x="153" y="147" width="86" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task"> - <dc:Bounds x="293" y="89" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ScriptTask_1qmmew8_di" bpmnElement="instantiate_NSTask"> - <dc:Bounds x="474" y="89" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Event_0l9vk9p_di" bpmnElement="Event_0l9vk9p"> <dc:Bounds x="175" y="357" width="36" height="36" /> <bpmndi:BPMNLabel> @@ -163,16 +143,19 @@ dcsi.createSliceProfile(execution)</bpmn:script> <dc:Bounds x="972" y="357" width="36" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Event_1a9swwa_di" bpmnElement="Event_1a9swwa"> - <dc:Bounds x="1102" y="111" width="36" height="36" /> + <dc:Bounds x="982" y="111" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1093" y="154" width="59" height="27" /> + <dc:Bounds x="973" y="154" width="59" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_18rzwzb_di" bpmnElement="ScriptTask_18rzwzb"> - <dc:Bounds x="830" y="89" width="100" height="80" /> + <dc:Bounds x="730" y="89" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Activity_08tw2di_di" bpmnElement="Activity_08tw2di"> - <dc:Bounds x="650" y="89" width="100" height="80" /> + <bpmndi:BPMNShape id="ScriptTask_1qmmew8_di" bpmnElement="instantiate_NSTask"> + <dc:Bounds x="500" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task"> + <dc:Bounds x="310" y="89" width="100" height="80" /> </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java index f7c42b97e9..b706be92cb 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/vfmodule/CreateVFModule.java @@ -44,7 +44,11 @@ public class CreateVFModule { CloudInformation cloudInformation = new CloudInformation(); cloudInformation.setOwner(gBBInput.getCloudRegion().getCloudOwner()); cloudInformation.setRegionId(gBBInput.getCloudRegion().getLcpCloudRegionId()); - cloudInformation.setTenantId(gBBInput.getTenant().getTenantId()); + String tenantId = gBBInput.getTenant().getTenantId(); + if (tenantId == null) { + tenantId = gBBInput.getCloudRegion().getTenantId(); + } + cloudInformation.setTenantId(tenantId); cloudInformation.setTenantName(gBBInput.getTenant().getTenantName()); cloudInformation.setTenantContext(gBBInput.getTenant().getTenantContext()); cloudInformation.setTemplateInstanceId(execution.getVariable("heatStackId")); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index d9ad245e76..7c4f735577 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -30,6 +30,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Optional; @@ -1663,8 +1664,11 @@ public class WorkflowAction { execution.setVariable(BBConstants.G_ISTOPLEVELFLOW, northBoundRequest.getIsToplevelflow()); } List<OrchestrationFlow> flows = northBoundRequest.getOrchestrationFlowList(); - if (flows == null) + if (flows == null) { flows = new ArrayList<>(); + } else { + flows.sort(Comparator.comparingInt(OrchestrationFlow::getSequenceNumber)); + } for (OrchestrationFlow flow : flows) { if (!flow.getFlowName().contains("BB") && !flow.getFlowName().contains("Activity")) { List<OrchestrationFlow> macroQueryFlows = diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java index 614401d32a..9899d89b5e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/aai/mapper/AAIObjectMapper.java @@ -52,7 +52,7 @@ import org.springframework.stereotype.Component; @Component public class AAIObjectMapper { - private static final ModelMapper modelMapper = new ModelMapper(); + private final ModelMapper modelMapper = new ModelMapper(); public org.onap.aai.domain.yang.ServiceInstance mapServiceInstance(ServiceInstance serviceInstance) { if (modelMapper.getTypeMap(ServiceInstance.class, org.onap.aai.domain.yang.ServiceInstance.class) == null) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 53d1bea1f2..50ff074866 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -3110,9 +3110,11 @@ public class WorkflowActionTest extends BaseTaskTest { private List<OrchestrationFlow> createFlowList(String... flowNames) { List<OrchestrationFlow> result = new ArrayList<>(); + int sequenceNumber = 1; for (String flowName : flowNames) { OrchestrationFlow orchFlow = new OrchestrationFlow(); orchFlow.setFlowName(flowName); + orchFlow.setSequenceNumber(sequenceNumber++); result.add(orchFlow); } return result; |