summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorc00149107 <chenchuanyu@huawei.com>2017-10-13 10:48:59 +0800
committerSeshu Kumar M <seshu.kumar.m@huawei.com>2017-10-13 07:01:47 +0000
commit64d0ab5ebd9121de878d7932e2469afae74c8a99 (patch)
tree8229a2096406447cd5a7dade12950b74db6d5949 /bpmn/MSOInfrastructureBPMN/src/main/groovy
parent18345bdd80561efd7031086d48b2321b69d2e0e4 (diff)
Correct the workflow for NS Create
Correct the workflow for NS Create bpmn Change-Id: I71283c88a3936d1b19b3403f6940823875405c90 Issue-ID:SO-217 Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy34
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy6
2 files changed, 36 insertions, 4 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index 7505eed348..b053b4e7d8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -179,7 +179,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("modelVersion", modelVersion)
execution.setVariable("modelUuid", modelUuid)
execution.setVariable("modelName", modelName)
-
+
StringBuilder sbParams = new StringBuilder()
Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
if (paramsMap != null)
@@ -666,4 +666,36 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
}
+ /**
+ * prepare resource create request
+ */
+ public void preResourceRequest(execution, resourceName){
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ String serviceInstanceName = execution.getVariable("serviceInstanceName")
+ String nsServiceName = nsName + "_" + serviceInstanceName
+ String nsServiceDescription = execution.getVariable("serviceInstanceDescription")
+ execution.setVariable("nsServiceName", nsServiceName)
+ utils.log("DEBUG", "Prepare VFC Request nsServiceName:" + nsServiceName, isDebugEnabled)
+ execution.setVariable("nsServiceDescription", nsServiceDescription)
+ utils.log("DEBUG", "Prepare VFC Request nsServiceDescription:" + nsServiceDescription, isDebugEnabled)
+ String globalSubscriberId = execution.getVariable("globalSubscriberId")
+ String serviceType = execution.getVariable("serviceType")
+ String serviceId = execution.getVariable("serviceId")
+ String operationId = execution.getVariable("operationId")
+ String incomingRequest = execution.getVariable("bpmnRequest")
+ Map serviceReq = jsonSlurper.parseText(incomingRequest)
+ def segmentList = serviceReq.service.parameters.segments
+ if (segmentList != null) {
+ segmentList.each {
+ if(StringUtils.containsIgnoreCase(it.resourceName, nsName)){
+ String resourceActualName = it.resourceName
+ String resourceUUID = it.resourceUUID
+ String resourceParameters = it.nsParameters
+ execution.setVariable("resourceName", resourceActualName)
+ execution.setVariable("resourceUUID", resourceUUID)
+ execution.setVariable("resourceParameters", resourceParameters)
+ }
+ }
+ }
+ }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
index b346faf4c6..6c0dedfe78 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy
@@ -80,7 +80,7 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
utils.log("DEBUG", "serviceId:" + serviceId, isDebugEnabled)
String operationId = execution.getVariable("operationId")
utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
- String nodeTemplateUUID = execution.getVariable("nodeTemplateUUID")
+ String nodeTemplateUUID = execution.getVariable("resourceUUID")
utils.log("DEBUG", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled)
/*
* segmentInformation needed as a object of segment
@@ -93,13 +93,13 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces
* }
* }
*/
- String siRequest = execution.getVariable("segmentInformation")
+ String nsParameters = execution.getVariable("resourceParamters")
utils.log("DEBUG", "Input Request:" + siRequest, isDebugEnabled)
String nsOperationKey = "{\"globalSubscriberId\":\"" + globalSubscriberId + "\",\"serviceType:\""
+ serviceType + "\",\"serviceId\":\"" + serviceId + "\",\"operationId\":\"" + operationId
+"\",\"nodeTemplateUUID\":\"" + nodeTemplateUUID + "\"}";
execution.setVariable("nsOperationKey", nsOperationKey);
- execution.setVariable("nsParameters", jsonUtil.getJsonValue(siRequest, "nsParameters"))
+ execution.setVariable("nsParameters", nsParameters)
} catch (BpmnError e) {