From 2ff62a6d6026c073efd3e96029ac48a537b13e3e Mon Sep 17 00:00:00 2001 From: c00149107 Date: Fri, 20 Apr 2018 17:02:24 +0800 Subject: Update create flow for E2E service Update create generic flow for E2E service Change-Id: I7f5c912348ce0d0ee9035aa3a5e34979ee14b247 Issue-ID: SO-583 Signed-off-by: c00149107 --- .../scripts/CreateVFCNSResource.groovy | 30 ++++++++++++++-- .../resources/process/CreateVFCNSResource.bpmn | 42 +++++++++++++++------- 2 files changed, 57 insertions(+), 15 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy index 9456007dc8..ca32420b73 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy @@ -87,10 +87,11 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { String serviceId = execution.getVariable("serviceInstanceId") utils.log("INFO", "serviceId:" + serviceId, isDebugEnabled) - String operationId = execution.getVariable("requestId") + String operationId = jsonUtil.getJsonValue(resourceInput, "operationId") utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled) - String nodeTemplateUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid") + String nodeTemplateUUID = jsonUtil.getJsonValue(resourceInput, "resourceModelInfo.modelCustomizationUuid") + String nsServiceModelUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid") utils.log("INFO", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled) /* * segmentInformation needed as a object of segment @@ -114,6 +115,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { }""" execution.setVariable("nsOperationKey", nsOperationKey); execution.setVariable("nsParameters", nsParameters) + execution.setVariable("nsServiceModelUUID", nsServiceModelUUID); } catch (BpmnError e) { @@ -133,6 +135,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") utils.log("INFO"," ***** createNetworkService *****", isDebugEnabled) String nsOperationKey = execution.getVariable("nsOperationKey"); + String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID"); String nsParameters = execution.getVariable("nsParameters"); String nsServiceName = execution.getVariable("nsServiceName") String nsServiceDescription = execution.getVariable("nsServiceDescription") @@ -141,6 +144,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { String reqBody ="""{ "nsServiceName":"${nsServiceName}", "nsServiceDescription":"${nsServiceDescription}", + "nsServiceModelUUID":"${nsServiceModelUUID}", "nsOperationKey":${nsOperationKey}, "nsParameters":{ "locationConstraints":${locationConstraints}, @@ -305,4 +309,26 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { } return apiResponse } + + public void sendSyncResponse (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled) + + try { + String nsInstanceId = execution.getVariable("nsInstanceId") + String operationStatus = execution.getVariable("operationStatus") + // RESTResponse for main flow + String createVFCResourceRestRsp = """{"nsInstanceId":"${nsInstanceId}","operationStatus":"${operationStatus}"}""".trim() + utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createVFCResourceRestRsp, isDebugEnabled) + sendWorkflowResponse(execution, 202, createVFCResourceRestRsp) + execution.setVariable("sentSyncResponse", true) + + } catch (Exception ex) { + String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage() + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled) + } + } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn index e4254f2d9e..2370165354 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn @@ -34,10 +34,10 @@ dcsi.instantiateNetworkService(execution)]]> createNSFailed_SequenceFlow - + - + SequenceFlow_1ywe21t @@ -62,7 +62,7 @@ dcsi.instantiateNetworkService(execution)]]> - + createNSFailed_SequenceFlow @@ -70,7 +70,7 @@ dcsi.instantiateNetworkService(execution)]]> instantiateFailed_SequenceFlow - SequenceFlow_0cq2q6g + SequenceFlow_1lwqmo9 instantiateSuccess_SequenceFlow @@ -80,7 +80,7 @@ dcsi.instantiateNetworkService(execution)]]> def dcsi = new CreateVFCNSResource() dcsi.queryNSProgress(execution)]]> - + operationFinished_SequenceFlow SequenceFlow_0cq2q6g + + SequenceFlow_0cq2q6g + SequenceFlow_1lwqmo9 + + + @@ -192,11 +200,9 @@ dcsi.timeDelay(execution)]]> - - - + - + @@ -208,10 +214,10 @@ dcsi.timeDelay(execution)]]> - - + + - + @@ -236,7 +242,7 @@ dcsi.timeDelay(execution)]]> - + @@ -256,6 +262,16 @@ dcsi.timeDelay(execution)]]> + + + + + + + + + + -- cgit 1.2.3-korg