- public void parse(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
- String fn = "RestServiceNode.sendRequest";
- log.info("Received processParamKeys call with params : " + inParams);
- String responsePrefix = inParams.get(FlowControllerConstants.INPUT_PARAM_RESPONSE_PRIFIX);
- responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
- try {
- //Remove below for Block
- JsonNode jnode = isValidJSON(inParams.get("data"));
- if(jnode != null) {
- Map<String, Object> map = new ObjectMapper().readValue(jnode.toString(), new TypeReference<Map<String, String>>(){});
- for (Entry<String, Object> entry : map.entrySet())
- {
- ctx.setAttribute(responsePrefix + entry.getKey(),(String) entry.getValue());
- }
- }
- ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_STATUS, FlowControllerConstants.OUTPUT_STATUS_SUCCESS);
-
- } catch (Exception e) {
- ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_STATUS, FlowControllerConstants.OUTPUT_STATUS_FAILURE);
- ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
- log.error(fn + " Error Message : " + e.getMessage(), e);
- throw new SvcLogicException(e.getMessage());
+ if (node != null) {
+ Map<String, String> map = convertToMap(node);
+ for (Entry<String, String> entry : map.entrySet()) {
+ ctx.setAttribute(responsePrefix + entry.getKey(), entry.getValue());