diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-05-31 10:00:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-05-31 10:00:40 +0000 |
commit | d0e24a65c4f84bcd5322b02abd0e19eb1a4d7c78 (patch) | |
tree | 08973e6b04ae1c554bc386cdafaa6400712e058a /bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp | |
parent | 2340ce33ccc486f0c6e0b23dc7fb332616345f68 (diff) | |
parent | c8981f10b0332aa30a3d1861409b3e9e5296cabe (diff) |
Merge "Throw exception if resource receipe is not avail"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy index ae75d54afe..9cdbdfde1c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -245,10 +245,19 @@ public class DoCreateResources extends AbstractServiceTaskProcessor //String requestAction = resourceInput.getOperationType() String requestAction = "createInstance" JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceInput.getResourceModelInfo().getModelUuid(), requestAction) - 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) + + 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) + } else { + String exceptionMessage = "Resource receipe is not found for resource modeluuid: " + + resourceInput.getResourceModelInfo().getModelUuid() + utils.log("ERROR", exceptionMessage, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, exceptionMessage) + } + utils.log("INFO", "======== end executeResourceRecipe Process ======== ", isDebugEnabled) } |