From 2479d5fde271fd1296fd4e1ae58a8608991496f8 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Fri, 27 Apr 2018 17:22:59 +0800 Subject: Change to sdncadapter for service call Change to sdncadapter for service call Change-Id: I9011e69fba20d4d0f83705455791b7357e2f5bb0 Issue-ID: SO-587 Signed-off-by: c00149107 --- .../scripts/DoDeleteResourcesV1.groovy | 92 ++++++++++++--- .../resources/subprocess/DoDeleteResourcesV1.bpmn | 123 +++++++++++++++------ 2 files changed, 165 insertions(+), 50 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy index 92e7fdded5..f08a769fb1 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy @@ -309,20 +309,84 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor { execution.setVariable("CVFMI_updateResOperStatusRequest", body) } - public void prepareServiceTopologyDeletion(DelegateExecution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("INFO"," ***** prepareServiceTopologyDeletion " + " *****", isDebugEnabled) - - ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") - execution.setVariable("modelInvariantUuid", serviceDecomposition.getModelInfo().getModelInvariantUuid()) - execution.setVariable("modelVersion", serviceDecomposition.getModelInfo().getModelVersion()) - execution.setVariable("modelUuid", serviceDecomposition.getModelInfo().getModelUuid()) - execution.setVariable("serviceModelName", serviceDecomposition.getModelInfo().getModelName()) + public void prepareSDNCServiceDeactivateRequest (DelegateExecution execution) { + prepareSDNCServiceRequest (execution, "deactivate") + } + + public void prepareSDNCServiceDeleteRequest (DelegateExecution execution) { + prepareSDNCServiceRequest (execution, "delete") + } + + public void prepareSDNCServiceRequest (DelegateExecution execution, String svcAction) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + utils.log("INFO"," ***** Started prepareSDNCServiceRequest for " + svcAction + "*****", isDebugEnabled) - // set operation type and resource type is required to form request body - execution.setVariable("operationType", "DELETE") - execution.setVariable("resourceType", "SDNC-SERVICE-TOPOLOGY") + try { + // get variables + String sdnc_svcAction = svcAction + String sdncCallback = execution.getVariable("URN_mso_workflow_sdncadapter_callback") + String hdrRequestId = execution.getVariable("msoRequestId") + String serviceInstanceId = execution.getVariable("serviceInstanceId") + String source = execution.getVariable("source") + String sdnc_service_id = serviceInstanceId + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + String serviceType = execution.getVariable("serviceType") + String globalCustomerId = execution.getVariable("globalSubscriberId") + String serviceModelInvariantUuid = serviceDecomposition.getModelInfo().getModelInvariantUuid() + String serviceModelUuid = serviceDecomposition.getModelInfo().getModelUuid() + String serviceModelVersion = serviceDecomposition.getModelInfo().getModelVersion() + String serviceModelName = serviceDecomposition.getModelInfo().getModelName() + + // 1. prepare assign topology via SDNC Adapter SUBFLOW call + String sndcTopologyDeleteRequest = + """ + + ${hdrRequestId} + ${serviceInstanceId} + ${sdnc_svcAction} + service-topology-operation + sdncCallback + generic-resource + + + + ${hdrRequestId} + DeleteServiceInstance + ${source} + + + + + + ${serviceInstanceId} + ${serviceType} + + ${serviceModelInvariantUuid} + ${serviceModelUuid} + ${serviceModelVersion} + ${serviceModelName} + + ${serviceInstanceId} + ${globalCustomerId} + + + + + """.trim() + + String sndcTopologyDeleteRequesAsString = utils.formatXml(sndcTopologyDeleteRequest) + utils.logAudit(sndcTopologyDeleteRequesAsString) + execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyDeleteRequesAsString) + utils.log("INFO","sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyDeleteRequesAsString, isDebugEnabled) + + } catch (Exception ex) { + String exceptionMessage = " Bpmn error encountered in DoDeleteResourcesV1 flow. prepareSDNCServiceRequest() - " + ex.getMessage() + utils.log("DEBUG", exceptionMessage, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) - utils.log("INFO"," ***** prepareServiceTopologyDeletion " + " *****", isDebugEnabled) - } + } + utils.log("INFO","***** Exit prepareSDNCServiceRequest for " + svcAction + "*****", isDebugEnabled) + } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteResourcesV1.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteResourcesV1.bpmn index b74c169d26..24f16817c4 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteResourcesV1.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteResourcesV1.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0stqur4 @@ -57,10 +57,6 @@ ex.processJavaException(execution)]]> - - SequenceFlow_11h5pba - SequenceFlow_174yrgl - SequenceFlow_1yrkxjm SequenceFlow_1s1nnmj @@ -73,7 +69,6 @@ ex.processJavaException(execution)]]> - @@ -87,8 +82,8 @@ ex.processJavaException(execution)]]> - SequenceFlow_174yrgl SequenceFlow_0lk19rm + SequenceFlow_14fx6hv SequenceFlow_0o21fg8 @@ -148,14 +143,50 @@ dcsi.prepareFinishedProgressForResource(execution)]]> - - + + SequenceFlow_1s1nnmj SequenceFlow_11h5pba +ddr.prepareSDNCServiceDeactivateRequest(execution)]]> + + + + + + + + + + + + SequenceFlow_11h5pba + SequenceFlow_0gqlayv + + + + + + + + + + + + + SequenceFlow_0etaubw + SequenceFlow_14fx6hv + + + + SequenceFlow_0gqlayv + SequenceFlow_0etaubw + + @@ -249,9 +280,6 @@ ddr.prepareServiceTopologyDeletion(execution)]]> - - - @@ -266,32 +294,25 @@ ddr.prepareServiceTopologyDeletion(execution)]]> - + - + - - - - - - - - + - + - - + + - + @@ -314,16 +335,16 @@ ddr.prepareServiceTopologyDeletion(execution)]]> - + - + - - + + - + @@ -390,15 +411,45 @@ ddr.prepareServiceTopologyDeletion(execution)]]> - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg