summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-11-17 06:25:07 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-17 06:25:07 +0000
commitccd82f6969667aaa08ec322b152ef084d057950d (patch)
treeea2bf41144a347511f10bb4bb9a48f73c2e9ee98
parent6ec858d14eb08e17e8194b492a2008039764c635 (diff)
parentef4f0b94f8087f38a7511f6a45dbdfa1878b5739 (diff)
Merge "Fix invocation of resource receipe"
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy12
2 files changed, 9 insertions, 5 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
index 0cce8b3f94..1989ca8cf9 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
@@ -266,7 +266,7 @@ public class ResourceRequestBuilder {
HashMap<String, String> map = new Gson().fromJson(value, new TypeToken<HashMap<String, String>>() {}.getType());
- String filePath = System.getProperty("mso.config.path") + "ASDC/" + map.get("version") + "/" + map.get("name");
+ String filePath = System.getProperty("mso.config.path") + "/ASDC/" + map.get("version") + "/" + map.get("name");
File csarFile = new File(filePath);
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()