From ce37ae979311ed4e55150426d477db262773beb0 Mon Sep 17 00:00:00 2001 From: "Brittany Plummer (bp896r)" Date: Tue, 6 Nov 2018 09:51:10 -0500 Subject: Removed slashes and added catch block Issue-ID: SO-1183 Change-Id: Ib8581393d782f078fc844cf96cbf7a0228133581 Signed-off-by: Brittany Plummer (bp896r) --- .../flowspecific/tasks/ConfigurationScaleOut.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java index d13c5db871..58dd5a1df6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java @@ -95,10 +95,13 @@ public class ConfigurationScaleOut { for (Map.Entry entry : param.entrySet()) { key = entry.getKey(); paramValue = entry.getValue(); - configScaleOutParam = JsonPath.parse(sdncVfModuleQueryResponse).read(paramValue); - if(configScaleOutParam != null){ - paramsMap.put(key, configScaleOutParam); + try{ + configScaleOutParam = JsonPath.parse(sdncVfModuleQueryResponse).read(paramValue); + }catch(ClassCastException e){ + configScaleOutParam = null; + msoLogger.warnSimple("Incorrect JSON path. Path points to object rather than value causing: ", e); } + paramsMap.put(key, configScaleOutParam); } } } @@ -107,7 +110,6 @@ public class ConfigurationScaleOut { configPayload.setConfigurationParameters(paramsMap); configPayload.setRequestParameters(requestParameters); configScaleOutPayloadString = mapper.writeValueAsString(configPayload); - configScaleOutPayloadString = configScaleOutPayloadString.replaceAll("\"", "\\\\\""); execution.setVariable(ACTION, actionCategory); execution.setVariable(MSO_REQUEST_ID, gBBInput.getRequestContext().getMsoRequestId()); -- cgit 1.2.3-korg