throws SdcToscaParserException {
Map<String, Object> resouceRequest = new HashMap<>();
- List<Map<String, Object>> param = new ArrayList<>();
String csarpath = null;
try {
csarpath = getCsarFromUuid(serviceUuid);
Property property = resourceProperties.get(key);
Object value = getValue(property.getValue(), serviceInputs, serInput);
- HashMap<String, Object> parameter = new HashMap<>();
- parameter.put("name", key);
- parameter.put("value", value);
- param.add(parameter);
+ resouceRequest.put(key, value);
}
}
- resouceRequest.put("param", param);
return resouceRequest;
}
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)\r
}\r
}\r
- \r
+\r
+ String customizeResourceParam(String netowrkInputParametersJson) {\r
+ List<Map<String, Object>> paramList = new ArrayList();\r
+ JSONObject jsonObject = new JSONObject(netowrkInputParametersJson);\r
+ Iterator iterator = jsonObject.keys();\r
+ while (iterator.hasNext()) {\r
+ String key = iterator.next();\r
+ HashMap<String, String> hashMap = new HashMap();\r
+ hashMap.put("name", key);\r
+ hashMap.put("value", jsonObject.get(key))\r
+ paramList.add(hashMap)\r
+ }\r
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap();\r
+ paramMap.put("param", paramList);\r
+\r
+ return new JSONObject(paramMap).toString();\r
+ }\r
\r
/**\r
* Pre Process the BPMN Flow Request\r
String resourceInputPrameters = resourceInputObj.getResourceParameters()\r
String netowrkInputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")\r
//here convert json string to xml string\r
- String netowrkInputParameters = XML.toString(new JSONObject(netowrkInputParametersJson))\r
+ String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(netowrkInputParametersJson)))\r
// 1. prepare assign topology via SDNC Adapter SUBFLOW call\r
String sndcTopologyCreateRequest =\r
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r