summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
authorIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-05-17 20:48:58 +0530
committerIsaac Manuel Raj <isaac.manuelraj@huawei.com>2019-05-21 06:24:58 +0000
commit140cd9c29a4f1ab9aa9590f07ac6b653ca459ffa (patch)
treed81da4df636c590f2d66da46256a49343464b52d /bpmn/MSOCommonBPMN/src/main
parent56c2c009a90f4f25c714e7773aaecf5e6957b499 (diff)
Fix SDNC Resource creation workflow
Fix SDNC Resource Creation workflow Issue-ID: SO-1393 Change-Id: Ia75150adf3695e623a2f3ec7ea5f720667142c1b Signed-off-by: Isaac Manuel Raj <isaac.manuelraj@huawei.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-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,