protected void addNodeStepFailureContextData(
            final StepExecutionResult dispatcherStepResult,
            final ExecutionContextImpl.Builder builder
    )
    {
        final Map<String, ? extends NodeStepResult> resultMap;
        if (NodeDispatchStepExecutor.isWrappedDispatcherResult(dispatcherStepResult)) {
            DispatcherResult dispatcherResult = NodeDispatchStepExecutor.extractDispatcherResult(dispatcherStepResult);
            resultMap = dispatcherResult.getResults();
        } else if (NodeDispatchStepExecutor.isWrappedDispatcherException(dispatcherStepResult)) {
            DispatcherException exception
                    = NodeDispatchStepExecutor.extractDispatcherException(dispatcherStepResult);
            HashMap<String, NodeStepResult> nodeResults = new HashMap<>();
            NodeStepException nodeStepException = exception.getNodeStepException();
            if (null != nodeStepException && null != exception.getNode()) {
                NodeStepResult nodeExecutorResult = nodeStepResultFromNodeStepException(
                        exception.getNode(),
                        nodeStepException
                );
                nodeResults.put(
                        nodeStepException.getNodeName(),
                        nodeExecutorResult
                );
            }
            resultMap = nodeResults;
        } else {
            return;
        }
        if (null != resultMap) {
            for (final Map.Entry<String, ? extends NodeStepResult> dentry : resultMap.entrySet()) {
                String nodename = dentry.getKey();
                NodeStepResult stepResult = dentry.getValue();
                HashMap<String, String> resultData = new HashMap<>();
                if (null != stepResult.getFailureData()) {
                    //convert values to string
                    for (final Map.Entry<String, Object> entry : stepResult.getFailureData().entrySet()) {
                        resultData.put(entry.getKey(), entry.getValue().toString());
                    }
                }
                FailureReason reason = stepResult.getFailureReason();
                if (null == reason) {
                    reason = StepFailureReason.Unknown;
                }
                resultData.put("reason", reason.toString());
                String message = stepResult.getFailureMessage();
                if (null == message) {
                    message = "No message";
                }
                resultData.put("message", message);
                //add to data context
//                builder.mergeContext("result", resultData);
                builder.nodeDataContext(nodename, new BaseDataContext("result", resultData));
            }
        }
    }
protected void addNodeStepFailureContextData ( final StepExecutionResult dispatcherStepResult , final ExecutionContextImpl . Builder builder ) { final Map < String , ? extends NodeStepResult > resultMap ; if ( NodeDispatchStepExecutor . isWrappedDispatcherResult ( dispatcherStepResult ) ) { DispatcherResult dispatcherResult = NodeDispatchStepExecutor . extractDispatcherResult ( dispatcherStepResult ) ; resultMap = dispatcherResult . getResults ( ) ; } else if ( NodeDispatchStepExecutor . isWrappedDispatcherException ( dispatcherStepResult ) ) { DispatcherException exception = NodeDispatchStepExecutor . extractDispatcherException ( dispatcherStepResult ) ; HashMap < String , NodeStepResult > nodeResults = new HashMap < > ( ) ; NodeStepException nodeStepException = exception . getNodeStepException ( ) ; if ( null != nodeStepException && null != exception . getNode ( ) ) { NodeStepResult nodeExecutorResult = nodeStepResultFromNodeStepException ( exception . getNode ( ) , nodeStepException ) ; nodeResults . put ( nodeStepException . getNodeName ( ) , nodeExecutorResult ) ; } resultMap = nodeResults ; } else { return ; } if ( null != resultMap ) { for ( final Map . Entry < String , ? extends NodeStepResult > dentry : resultMap . entrySet ( ) ) { String nodename = dentry . getKey ( ) ; NodeStepResult stepResult = dentry . getValue ( ) ; HashMap < String , String > resultData = new HashMap < > ( ) ; if ( null != stepResult . getFailureData ( ) ) { for ( final Map . Entry < String , Object > entry : stepResult . getFailureData ( ) . entrySet ( ) ) { resultData . put ( entry . getKey ( ) , entry . getValue ( ) . toString ( ) ) ; } } FailureReason reason = stepResult . getFailureReason ( ) ; if ( null == reason ) { reason = StepFailureReason . Unknown ; } resultData . put ( "reason" , reason . toString ( ) ) ; String message = stepResult . getFailureMessage ( ) ; if ( null == message ) { message = "No message" ; } resultData . put ( "message" , message ) ; builder . nodeDataContext ( nodename , new BaseDataContext ( "result" , resultData ) ) ; } } }
Add any node-specific step failure information to the node-specific data contexts

@param dispatcherStepResult result

@param builder
@return new context