From 64d0ab5ebd9121de878d7932e2469afae74c8a99 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Fri, 13 Oct 2017 10:48:59 +0800 Subject: Correct the workflow for NS Create Correct the workflow for NS Create bpmn Change-Id: I71283c88a3936d1b19b3403f6940823875405c90 Issue-ID:SO-217 Signed-off-by: c00149107 --- .../scripts/DoCreateE2EServiceInstance.groovy | 34 ++++- .../DoCreateVFCNetworkServiceInstance.groovy | 6 +- .../process/CreateCustomE2EServiceInstance.bpmn | 54 ++++--- .../subprocess/DoCreateE2EServiceInstance.bpmn | 162 +++++++++++++++------ 4 files changed, 185 insertions(+), 71 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src/main') 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 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) { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn index 0a80602705..b9d5e2c1d2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn @@ -113,7 +113,7 @@ csi.sendSyncError(execution)]]> - SequenceFlow_081z8l2 + SequenceFlow_194rnud SequenceFlow_19eilro def csi= new CreateCustomE2EServiceInstance() csi.InitServiceOperationStatus(execution)]]> - + @@ -171,6 +171,12 @@ csi.InitServiceOperationStatus(execution)]]> SequenceFlow_1euqjsp SequenceFlow_081z8l2 + + + SequenceFlow_081z8l2 + SequenceFlow_194rnud + + @@ -194,7 +200,7 @@ csi.InitServiceOperationStatus(execution)]]> - + @@ -206,7 +212,7 @@ csi.InitServiceOperationStatus(execution)]]> - + @@ -222,16 +228,16 @@ csi.InitServiceOperationStatus(execution)]]> - + - + - + - + @@ -249,10 +255,10 @@ csi.InitServiceOperationStatus(execution)]]> - - + + - + @@ -363,24 +369,34 @@ csi.InitServiceOperationStatus(execution)]]> - - + + - + - + - - + + - + - + + + + + + + + + + + diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn index 2e996e20d5..a76036668c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn @@ -128,24 +128,45 @@ ddsi.postProcessAAIPUT(execution)]]> - SequenceFlow_0k4q7jm + SequenceFlow_1hgiln0 SequenceFlow_0ofqw6v - + SequenceFlow_05gdjox SequenceFlow_15zgrcq +csi.preResourceRequest(execution, resourceName)]]> - + + + + + + + + + + SequenceFlow_0ofqw6v SequenceFlow_1vvdkcs - + + + + + + + + + + + + SequenceFlow_15zgrcq SequenceFlow_0k4q7jm @@ -164,7 +185,7 @@ csi.postConfigRequest(execution)]]> SequenceFlow_092ghvu - + SequenceFlow_1170ztf @@ -196,6 +217,31 @@ ddsi.preInitResourcesOperStatus(execution)]]> SequenceFlow_1qctzm0 SequenceFlow_05gdjox + + + SequenceFlow_0k4q7jm + SequenceFlow_0ua1bbk + + + + + + + + + + + + + + + + SequenceFlow_0ua1bbk + SequenceFlow_1hgiln0 + @@ -276,35 +322,35 @@ ddsi.preInitResourcesOperStatus(execution)]]> - + - + - + - + - + - + - - + + - + - - + + - + @@ -349,68 +395,68 @@ ddsi.preInitResourcesOperStatus(execution)]]> - + - - + + - + - + - - - - + + + + - + - + - + - + - + - - + + - + - + - + - - + + - + - - + + - + @@ -421,16 +467,16 @@ ddsi.preInitResourcesOperStatus(execution)]]> - + - + - + - + @@ -446,7 +492,7 @@ ddsi.preInitResourcesOperStatus(execution)]]> - + @@ -454,6 +500,26 @@ ddsi.preInitResourcesOperStatus(execution)]]> + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg