From 326db25f7ea828f5a9f69de39877b35db99a60ee Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Wed, 25 Apr 2018 10:05:06 +0000 Subject: Add sync response for VFCNS delete Add sync response for VFCNS delete Change-Id: I4917f0a83fc0c33d51b9b90d91f10dbdc023e690 Issue-ID: SO-422 Signed-off-by: subhash kumar singh --- .../scripts/DeleteVFCNSResource.groovy | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy index be099eb9af..e9d51b2965 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVFCNSResource.groovy @@ -44,4 +44,25 @@ public class DeleteVFCNSResource extends AbstractServiceTaskProcessor { utils.log("INFO"," ***** end postProcessRequest *****", isDebugEnabled) } + + 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) + } } \ No newline at end of file -- cgit 1.2.3-korg