aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-04-25 10:20:11 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-25 10:20:11 +0000
commit92a682e18131338717cc5e284322904bfb8796b5 (patch)
tree3476c548b71ce3063985b63696fd9a9debd0b725 /bpmn/MSOInfrastructureBPMN/src/main/groovy
parentc7c76f0e6d6aacf6f1b1cd07a42360291fde7e85 (diff)
parentb86a86fb01e9bb5c44098007a2e158d5b4fa17f0 (diff)
Merge "Set Resource Recipe Time Out Val"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy22
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy9
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy22
3 files changed, 46 insertions, 7 deletions
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)
+ }
}