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 +- 2 files changed, 72 insertions(+), 1 deletion(-) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy') 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) -- cgit 1.2.3-korg