summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-11-15 21:15:06 +0530
committerSeshu Kumar M <seshu.kumar.m@huawei.com>2018-11-17 03:22:57 +0000
commitef4f0b94f8087f38a7511f6a45dbdfa1878b5739 (patch)
treea819650174d36eec73e68cc1a2af29f3e74cb54b /bpmn/so-bpmn-infrastructure-common
parentce7d16089439d570c1c12764f7cd2372547d69f1 (diff)
Fix invocation of resource receipe
Fix invocation of resource receipe. Change-Id: I4ab14fa4924d7480b167138091de33f657286dde Issue-ID: SO-689 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com> (cherry picked from commit 9600bc37864e33e503001a4740fd5628a1069678)
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy12
1 files changed, 8 insertions, 4 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index 2167025e18..7707903391 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -242,7 +242,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
String resourceParameters = ResourceRequestBuilder.buildResourceRequestParameters(execution, serviceModelUuid, resourceCustomizationUuid, serviceParameters)
resourceInput.setResourceParameters(resourceParameters)
resourceInput.setRequestsInputs(incomingRequest)
- execution.setVariable("resourceInput", resourceInput)
+ execution.setVariable("resourceInput", resourceInput.toString())
+ execution.setVariable("resourceModelUUID", resourceInput.getResourceModelInfo().getModelUuid())
msoLogger.trace("COMPLETED prepareResourceRecipeRequest Process ")
}
@@ -253,18 +254,21 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
String requestId = execution.getVariable("msoRequestId")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String serviceType = execution.getVariable("serviceType")
- ResourceInput resourceInput = execution.getVariable("resourceInput")
+ String resourceInput = execution.getVariable("resourceInput")
+ String resourceModelUUID = execution.getVariable("resourceModelUUID")
// requestAction is action, not opertiontype
//String requestAction = resourceInput.getOperationType()
String requestAction = "createInstance"
- JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceInput.getResourceModelInfo().getModelUuid(), requestAction)
+ JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceModelUUID, requestAction)
if (resourceRecipe != null) {
String recipeURL = BPMNProperties.getProperty("bpelURL", "http://mso:8080") + resourceRecipe.getString("orchestrationUri")
int recipeTimeOut = resourceRecipe.getInt("recipeTimeout")
String recipeParamXsd = resourceRecipe.get("paramXSD")
- HttpResponse resp = BpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput.toString(), recipeParamXsd)
+
+ BpmnRestClient bpmnRestClient = new BpmnRestClient()
+ HttpResponse resp = bpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput, recipeParamXsd)
} else {
String exceptionMessage = "Resource receipe is not found for resource modeluuid: " +
resourceInput.getResourceModelInfo().getModelUuid()