aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
index d463fde09c..0f52c96d0e 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupMapperLayer.java
@@ -22,6 +22,7 @@ package org.onap.so.bpmn.servicedecomposition.tasks;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -84,6 +85,8 @@ import org.springframework.stereotype.Component;
@Component("BBInputSetupMapperLayer")
public class BBInputSetupMapperLayer {
+ private static final String USER_PARAM_NAME_KEY = "name";
+ private static final String USER_PARAM_VALUE_KEY = "value";
private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL,
BBInputSetupMapperLayer.class);
@@ -332,6 +335,7 @@ public class BBInputSetupMapperLayer {
if (null != requestParameters) {
context.setSubscriptionServiceType(requestParameters.getSubscriptionServiceType());
context.setRequestParameters(this.mapRequestParameters(requestDetails.getRequestParameters()));
+ context.setUserParams(this.mapNameValueUserParams(requestDetails.getRequestParameters()));
}
return context;
}
@@ -344,6 +348,20 @@ public class BBInputSetupMapperLayer {
requestParams.setPayload(requestParameters.getPayload());
return requestParams;
}
+
+ protected HashMap<String,String> mapNameValueUserParams(org.onap.so.serviceinstancebeans.RequestParameters requestParameters) {
+ HashMap<String,String> userParamsResult = new HashMap<String,String>();
+ if (requestParameters.getUserParams() != null) {
+ List<Map<String, Object>> userParams = requestParameters.getUserParams();
+ for (Map<String, Object> userParamsMap : userParams) {
+ if ( userParamsMap.containsKey(USER_PARAM_NAME_KEY) && (userParamsMap.get(USER_PARAM_NAME_KEY) instanceof String)
+ && userParamsMap.containsKey(USER_PARAM_VALUE_KEY) && (userParamsMap.get(USER_PARAM_VALUE_KEY) instanceof String)) {
+ userParamsResult.put((String) userParamsMap.get(USER_PARAM_NAME_KEY), (String) userParamsMap.get(USER_PARAM_VALUE_KEY));
+ }
+ }
+ }
+ return userParamsResult;
+ }
protected OrchestrationContext mapOrchestrationContext(RequestDetails requestDetails) {
OrchestrationContext context = new OrchestrationContext();