summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java7
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy20
2 files changed, 19 insertions, 8 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
index d32a06d89b..7c3ea37817 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
@@ -123,7 +123,6 @@ public class ResourceRequestBuilder {
throws SdcToscaParserException {
Map<String, Object> resouceRequest = new HashMap<>();
- List<Map<String, Object>> param = new ArrayList<>();
String csarpath = null;
try {
csarpath = getCsarFromUuid(serviceUuid);
@@ -147,13 +146,9 @@ public class ResourceRequestBuilder {
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;
}
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"