diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-04-22 03:00:55 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-22 03:00:55 +0000 |
commit | 54c41267ed3bf769b00875128fa5a9021411e1c1 (patch) | |
tree | 224980e3192406835bc703a15d11db46caeaae2f /bpmn/MSOInfrastructureBPMN/src/main | |
parent | 7ded7cc8a1c4282e4cc84d4f82f73491f0bf3f08 (diff) | |
parent | 66e5f2e595eb17f35af184ef18408b53e7f2f5a3 (diff) |
Merge "Fix request parameter building for sdnc resource"
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index 63fab7d389..ede76c0fd2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -120,7 +120,23 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
-
+
+ String customizeResourceParam(String netowrkInputParametersJson) {
+ List<Map<String, Object>> paramList = new ArrayList();
+ JSONObject jsonObject = new JSONObject(netowrkInputParametersJson);
+ Iterator iterator = jsonObject.keys();
+ while (iterator.hasNext()) {
+ String key = iterator.next();
+ HashMap<String, String> hashMap = new HashMap();
+ hashMap.put("name", key);
+ hashMap.put("value", jsonObject.get(key))
+ paramList.add(hashMap)
+ }
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap();
+ paramMap.put("param", paramList);
+
+ return new JSONObject(paramMap).toString();
+ }
/**
* Pre Process the BPMN Flow Request
@@ -158,7 +174,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String resourceInputPrameters = resourceInputObj.getResourceParameters()
String netowrkInputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
//here convert json string to xml string
- String netowrkInputParameters = XML.toString(new JSONObject(netowrkInputParametersJson))
+ String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(netowrkInputParametersJson)))
// 1. prepare assign topology via SDNC Adapter SUBFLOW call
String sndcTopologyCreateRequest =
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
|