aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java12
1 files changed, 11 insertions, 1 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 b814d6c595..8d02fa3e4f 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
@@ -113,7 +113,17 @@ public class ResourceRequestBuilder {
if (resource.getResourceType() == ResourceType.VNF) {
for (String eachResource : resourceList) {
String resCusUuid = JsonUtils.getJsonValue(eachResource, "resourceCustomizationUuid");
- if ((null != resCusUuid) && resCusUuid.equals(resource.getModelInfo().getModelCustomizationUuid())) {
+ // in case of external api invocation customizatoin id is coming null
+ if (resCusUuid == null || resCusUuid.contains("null") || resCusUuid.isEmpty()) {
+ logger.info("resource resolved using model uuid");
+ String uuid = (String) JsonUtils.getJsonValue(eachResource, "resourceUuid");
+ if ((null != uuid) && uuid.equals(resource.getModelInfo().getModelUuid())) {
+ logger.info("found resource uuid" + uuid);
+ String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters");
+ locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints");
+ }
+ } else if (resCusUuid.equals(resource.getModelInfo().getModelCustomizationUuid())) {
+ logger.info("resource resolved using customization-id");
String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters");
locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints");
}