From b86a86fb01e9bb5c44098007a2e158d5b4fa17f0 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Wed, 25 Apr 2018 17:19:13 +0800 Subject: Set Resource Recipe Time Out Val Set Resource Recipe Time Out Val Change-Id: I7f304465c71837ee37e5fa99a48ca14d97d8f91f Issue-ID: SO-587 Signed-off-by: c00149107 --- .../scripts/CreateSDNCNetworkResource.groovy | 22 ++++++++++++- .../scripts/CreateVFCNSResource.groovy | 9 +++-- .../scripts/DeleteSDNCNetworkResource.groovy | 22 ++++++++++++- .../process/CreateSDNCNetworkResource.bpmn | 30 +++++++++++++---- .../process/DeleteSDNCNetworkResource.bpmn | 38 ++++++++++++++++------ 5 files changed, 98 insertions(+), 23 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN') 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 f265638423..43b32a4d85 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 @@ -67,7 +67,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { try { //get bpmn inputs from resource request. - String requestId = execution.getVariable("requestId") + String requestId = execution.getVariable("mso-request-id") String requestAction = execution.getVariable("requestAction") utils.log("INFO","The requestAction is: " + requestAction, isDebugEnabled) String recipeParamsFromRequest = execution.getVariable("recipeParams") @@ -318,4 +318,24 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { utils.log("INFO","response from sdnc, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled) utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled) } + + public void sendSyncResponse (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled) + + try { + String operationStatus = "finished" + // RESTResponse for main flow + String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim() + utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled) + sendWorkflowResponse(execution, 202, resourceOperationResp) + 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/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy index 9f3910beed..5390ee92db 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 @@ -269,7 +269,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { utils.log("INFO", " ======== Started Execute AAI Put Process ======== ", isDebugEnabled) APIResponse apiResponse = null try{ - String uuid = utils.getRequestID() + String uuid = execution.getVariable("mso-request-id"); utils.log("INFO","Generated uuid is: " + uuid, isDebugEnabled) utils.log("INFO","URL to be used is: " + url, isDebugEnabled) String userName = execution.getVariable("URN_aai_auth") @@ -317,12 +317,11 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { 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) + String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim() + utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled) + sendWorkflowResponse(execution, 202, resourceOperationResp) execution.setVariable("sentSyncResponse", true) } catch (Exception ex) { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy index 73230c6f21..447fa63baf 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy @@ -67,7 +67,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { try { //get bpmn inputs from resource request. - String requestId = execution.getVariable("requestId") + String requestId = execution.getVariable("mso-request-id") String requestAction = execution.getVariable("requestAction") utils.log("INFO","The requestAction is: " + requestAction, isDebugEnabled) String recipeParamsFromRequest = execution.getVariable("recipeParams") @@ -297,4 +297,24 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { utils.log("INFO","response from sdnc, response code :" + responseCode + " response object :" + responseObj, isDebugEnabled) utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled) } + + public void sendSyncResponse (DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled) + + try { + String operationStatus = "finished" + // RESTResponse for main flow + String resourceOperationResp = """{"operationStatus":"${operationStatus}"}""".trim() + utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + resourceOperationResp, isDebugEnabled) + sendWorkflowResponse(execution, 202, resourceOperationResp) + 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/CreateSDNCNetworkResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn index 46555cf2d4..c074571265 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn @@ -14,7 +14,7 @@ def dcsi = new CreateSDNCNetworkResource() dcsi.prepareSDNCRequest(execution)]]> - SequenceFlow_0ow44q0 + SequenceFlow_17md60u @@ -31,7 +31,7 @@ dcsi.prepareSDNCRequest(execution)]]> SequenceFlow_1xk5xed - + SequenceFlow_1vnx1pp SequenceFlow_0ow44q0 @@ -117,6 +117,14 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]> + + SequenceFlow_0ow44q0 + SequenceFlow_17md60u + + + @@ -145,9 +153,9 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]> - + - + @@ -162,9 +170,9 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]> - + - + @@ -235,6 +243,16 @@ dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]> + + + + + + + + + + diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn index 7786299ab8..216b67a8bb 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteSDNCNetworkResource.bpmn @@ -14,7 +14,7 @@ def dcsi = new DeleteSDNCNetworkResource() dcsi.prepareSDNCRequest(execution)]]> - SequenceFlow_0ow44q0 + SequenceFlow_15wux6a @@ -31,7 +31,7 @@ dcsi.prepareSDNCRequest(execution)]]> SequenceFlow_1xk5xed - + SequenceFlow_1vnx1pp SequenceFlow_0ow44q0 @@ -117,6 +117,14 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]> + + SequenceFlow_0ow44q0 + SequenceFlow_15wux6a + + + @@ -145,9 +153,9 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]> - + - + @@ -161,14 +169,14 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]> - - + + - + - + @@ -230,9 +238,19 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]> - + + + + + + + + + + + - + -- cgit 1.2.3-korg