From 62fbfc8a97aa4f8766007c49c0165b4d8c50e4dc Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Fri, 20 Apr 2018 06:35:32 +0000 Subject: Fix Database update for SDNC resource Fix Database update for SDNC resource Change-Id: Ia7284510f6a9e802d3f3d5520ead3d63bb1f7ba0 Issue-ID: SO-422 Signed-off-by: subhash kumar singh --- .../scripts/CreateSDNCNetworkResource.groovy | 71 +++++++++ .../scripts/DoCreateResources.groovy | 2 +- .../process/CreateSDNCNetworkResource.bpmn | 170 +++++++++++++++++---- 3 files changed, 211 insertions(+), 32 deletions(-) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index 81266148ca..5eda2cc145 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -219,6 +219,77 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled) } + private void setProgressUpdateVariables(DelegateExecution execution, String body) { + def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") + execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) + execution.setVariable("CVFMI_updateResOperStatusRequest", body) + } + + public void prepareUpdateBeforeCreateSDNCResource(DelegateExecution execution) { + ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput") + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String ServiceInstanceId = resourceInputObj.getServiceInstanceId() + String operationId = resourceInputObj.getOperationId() + String progress = "20" + String status = "processing" + String statusDescription = "SDCN resource creation invoked" + + execution.getVariable("operationId") + + String body = """ + + + + + ${operType} + ${operationId} + ${progress} + ${resourceCustomizationUuid} + ${ServiceInstanceId} + ${status} + ${statusDescription} + + + """; + + setProgressUpdateVariables(execution, body) + + } + + public void prepareUpdateAfterCreateSDNCResource(execution) { + ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput") + String operType = resourceInputObj.getOperationType() + String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid() + String ServiceInstanceId = resourceInputObj.getServiceInstanceId() + String operationId = resourceInputObj.getOperationId() + String progress = "100" + String status = "Created" + String statusDescription = "SDCN resource creation completed" + + execution.getVariable("operationId") + + String body = """ + + + + + ${operType} + ${operationId} + ${progress} + ${resourceCustomizationUuid} + ${ServiceInstanceId} + ${status} + ${statusDescription} + + + """; + + setProgressUpdateVariables(execution, body) + } + public void postCreateSDNCCall(DelegateExecution execution){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") utils.log("INFO"," ***** Started prepareSDNCRequest *****", isDebugEnabled) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy index 6f41879e7d..ae75d54afe 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -209,7 +209,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor String serviceType = execution.getVariable("serviceType") String serviceInstanceId = execution.getVariable("serviceInstanceId") String operationId = execution.getVariable("operationId") - String operationType = execution.getVariable("operationType") + String operationType = "createInstance" resourceInput.setGlobalSubscriberId(globalSubscriberId) resourceInput.setServiceType(serviceType) resourceInput.setServiceInstanceId(serviceInstanceId) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn index fd7a27c031..dcd0b56418 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn @@ -5,7 +5,7 @@ SequenceFlow_1qo2pln - + SequenceFlow_18l3crb SequenceFlow_0khtova @@ -27,13 +27,13 @@ dcsi.prepareSDNCRequest(execution)]]> - SequenceFlow_0khtova + SequenceFlow_15mvedq SequenceFlow_1xk5xed - + - SequenceFlow_1xk5xed + SequenceFlow_1vnx1pp SequenceFlow_0ow44q0 def dcsi = new CreateSDNCNetworkResource() dcsi.preProcessRequest(execution)]]> + + + + SequenceFlow_0khtova + SequenceFlow_1mz0vdx + + + + SequenceFlow_1xk5xed + SequenceFlow_1jr6zi0 + + + + + + + ${CVFMI_dbAdapterEndpoint} + + + application/soap+xml + Basic QlBFTENsaWVudDpwYXNzd29yZDEk + + + ${CVFMI_updateResOperStatusRequest} + POST + ${statusCode} + ${response} + + http-connector + + + SequenceFlow_1mz0vdx + SequenceFlow_15mvedq + + + + + + ${CVFMI_dbAdapterEndpoint} + + + application/soap+xml + Basic QlBFTENsaWVudDpwYXNzd29yZDEk + + + ${CVFMI_updateResOperStatusRequest} + POST + ${statusCode} + ${response} + + http-connector + + + SequenceFlow_1jr6zi0 + SequenceFlow_1vnx1pp + + + - + - + - - + + - + - - + + + - + - + - + - + - + - - + + - + - - + + - + - + - - + + - + - - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg