aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2019-05-21 07:06:24 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-21 07:06:24 +0000
commit832a7bc6114ef9f539fc172004d3d1c2c355dd62 (patch)
tree960443632a6d540ec85357f302ee1fbd83a976e9 /bpmn/MSOCommonBPMN/src
parent6ccd240f9a6fa92939432eb43b66b28c2147945e (diff)
parent140cd9c29a4f1ab9aa9590f07ac6b653ca459ffa (diff)
Merge "Fix SDNC Resource creation workflow"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/recipe/ResourceInput.java24
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java14
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,