aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy/org
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-04-20 06:35:32 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-04-20 06:35:32 +0000
commit62fbfc8a97aa4f8766007c49c0165b4d8c50e4dc (patch)
tree498ecce189eeab1f2719047620f6b5b994949dc8 /bpmn/MSOInfrastructureBPMN/src/main/groovy/org
parent77f89f7bee4ee93225495183d80ea95a437e497d (diff)
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 <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy71
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy2
2 files changed, 72 insertions, 1 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 = """
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateResourceOperationStatus>
+ <operType>${operType}</operType>
+ <operationId>${operationId}</operationId>
+ <progress>${progress}</progress>
+ <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>
+ <serviceId>${ServiceInstanceId}</serviceId>
+ <status>${status}</status>
+ <statusDescription>${statusDescription}</statusDescription>
+ </ns:updateResourceOperationStatus>
+ </soapenv:Body>
+ </soapenv:Envelope>""";
+
+ 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 = """
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateResourceOperationStatus>
+ <operType>${operType}</operType>
+ <operationId>${operationId}</operationId>
+ <progress>${progress}</progress>
+ <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>
+ <serviceId>${ServiceInstanceId}</serviceId>
+ <status>${status}</status>
+ <statusDescription>${statusDescription}</statusDescription>
+ </ns:updateResourceOperationStatus>
+ </soapenv:Body>
+ </soapenv:Envelope>""";
+
+ 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)