Class NodeReturnedException

    • Constructor Detail

      • NodeReturnedException

        public NodeReturnedException​(WorkflowNode node,
                                     Object alwaysData,
                                     Object successData,
                                     IWorkflowFileValue fileValue,
                                     List<NodeSoftErrorException> softErrors,
                                     String message)
        Creates a new exception that should be thrown when a node wishes to return.
        Parameters:
        node - The The node that did return.
        alwaysData - Data always provided by the node, regardless of how it completed.
        successData - Data provided by the node when successful.
        fileValue - Files provided by the node.
        softErrors - Soft errors that occurred during the node's execution.
        message - Message why the note returned, usually empty.
      • NodeReturnedException

        public NodeReturnedException​(WorkflowNode node,
                                     Object alwaysData,
                                     Object successData,
                                     IWorkflowFileValue fileValue,
                                     List<NodeSoftErrorException> softErrors,
                                     String message,
                                     Throwable e)
        Creates a new exception that should be thrown when a node wishes to return.
        Parameters:
        node - The The node that did return.
        alwaysData - Data always provided by the node, regardless of how it completed.
        successData - Data provided by the node when successful.
        fileValue - Files provided by the node.
        softErrors - Soft errors that occurred during the node's execution.
        message - Message why the note returned, usually empty.
        e - Cause that resulted in the node returning, usually null.
      • NodeReturnedException

        public NodeReturnedException​(WorkflowNode node,
                                     Object alwaysData,
                                     Object successData,
                                     IWorkflowFileValue fileValue,
                                     List<NodeSoftErrorException> softErrors,
                                     Throwable e)
        Creates a new exception that should be thrown when a node wishes to return.
        Parameters:
        node - The The node that did return.
        alwaysData - Data always provided by the node, regardless of how it completed.
        successData - Data provided by the node when successful.
        fileValue - Files provided by the node.
        softErrors - Soft errors that occurred during the node's execution.
        e - Cause that resulted in the node returning, usually null.
    • Method Detail

      • getSoftErrors

        public List<NodeSoftErrorException> getSoftErrors()
        Description copied from interface: ISuccessResultData
        Business logic might need to distinguish between hard errors and soft errors. A hard error is an exception that results in the workflow failing when not caught by an error handler. These are for example technical errors such as a missing database connection, or when a file cannot be read form the file system due to missing permissions.

        Soft errors are similar to warnings in that not all of the the business logic could be performed or that some the business logic had to be skipped. In contrast with hard errors, however, the node itself still completes normally and does not cause the workflow to fail. This method can be used to check if any soft errors occurred.

        Soft errors are similar to hard errors in that both provide an error code, an error message, as well as custom additional data.

        Common examples of soft errors include missing files from optional upload form elements, or a 4xx HTTP return code. However, the exact definition of what constitutes a soft error must be decided on a case-by-case basis by each individual node implementation. This method is meant to be a uniform interface for nodes to provide information about soft errors. This method can also be used to check whether a node was "successful", by checking whether the list of soft errors is empty. Implementations are encouraged to provide more details about their completion status via ISuccessResultData.getSuccessValue().

        Soft errors are purely informational. Workflow execution is not affected in any way by whether or not soft error occurred. The node still either completes normally or returns, and the next node or trigger is processed as if no soft errors were present.

        Specified by:
        getSoftErrors in interface ISuccessResultData
        Returns:
        A list of soft errors that did occur during the execution of the workflow node.