diff options
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
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) {
|