diff options
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/ResourceInput.java | 24 | ||||
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java | 14 |
2 files changed, 33 insertions, 5 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/ResourceInput.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/ResourceInput.java index 2bb024897c..33c48fbe44 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/ResourceInput.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/ResourceInput.java @@ -84,6 +84,30 @@ public class ResourceInput { @JsonProperty("operationType") private String operationType; + @JsonProperty("vfModelInfo") + private ModelInfo vfModelInfo; + + + @JsonProperty("vnf-Id") + private String vnfId; + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public ModelInfo getVfModelInfo() { + return vfModelInfo; + } + + public void setVfModelInfo(ModelInfo vfModelInfo) { + this.vfModelInfo = vfModelInfo; + } + + /** * @return Returns the requestsInputs. */ diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java index 71ea3b565b..e32a03dfa2 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java @@ -98,8 +98,6 @@ public class InstanceResourceList { // ....} // it will return sdwansiteresource_list private static String getPrimaryKey(Resource resource) { - String pk = ""; - String resourceInput = ""; if (resource instanceof VnfResource) { resourceInput = ((VnfResource) resource).getResourceInput(); @@ -111,10 +109,16 @@ public class InstanceResourceList { Type type = new TypeToken<Map<String, String>>() {}.getType(); Map<String, String> map = gson.fromJson(resourceInput, type); - Optional<String> pkOpt = map.values().stream().filter(e -> e.contains("[")).map(e -> e.replace("[", "")) - .map(e -> e.split(",")[0]).findFirst(); + if (map != null) { + Optional<String> pkOpt = map.values().stream().filter(e -> e.contains("[")).map(e -> e.replace("[", "")) + .map(e -> e.split(",")[0]).findFirst(); - return pkOpt.isPresent() ? pkOpt.get() : ""; + return pkOpt.isPresent() ? pkOpt.get() : ""; + } else { + // TODO: handle the case if VNF resource is not list + // e.g. { resourceInput + return ""; + } } private static List<Resource> convertToInstanceResourceList(Map<String, List<List<GroupResource>>> normalizedReq, |