Interface INodeExecutionParams<Model>

    • Method Detail

      • currentValue

        ICurrentValueBuilder currentValue()
        When the node is being executed, use this method to create the current data for the node and provide it.
        Returns:
        A builder for providing the current value while the node is being executed.
      • getNode

        WorkflowNode getNode()
        Returns:
        The node that needs to be executed.
      • getWorkflowContext

        IWorkflowExecutionContext getWorkflowContext()
        Returns:
        The workflow context of the current workflow execution. Use this context to access various system related features, such as replacing placeholders, retrieving / writing files, or sending HTTP responses.
      • normalResult

        INormalCompletionResultBuilder normalResult()
        When the node was executed normally (without an exception and without returning), use this method to create the result and return it.
        Returns:
        A builder for a normal completion result.
      • resetCurrentValue

        void resetCurrentValue()
        Discards all data that was configured for currentValue(). Normally not necessary, as the data is reset automatically e.g. between loop iterations, but sometimes you may need to reset it manually.
      • returningException

        INodeReturnedExceptionBuilder returningException()
        When the node was executed, and you wish to stop the execution of the current workflow task via a return statement, create a returning exception with this method and throw it.
        Returns:
        A builder for a returning exception.
      • softError

        @Deprecated
        default <T> void softError​(String errorCode,
                                   Class<T> memberClass,
                                   String message,
                                   IValueCreator valueCreator)
        Deprecated.
        Use softError(String, String, IValueCreator). The member class is not required anymore.
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

        Parameters:
        errorCode - String with the soft error type.
        memberClass - Type of the value for that soft error type.
        message - Message providing more details about the error .
        valueCreator - Function that takes a value builder to create the soft error value.
        Since:
        8.0.0
      • softError

        @Deprecated
        default <T> void softError​(String errorCode,
                                   Class<T> memberClass,
                                   String message,
                                   IValueCreator valueCreator,
                                   Throwable cause)
        Deprecated.
        use softError(String, String, IValueCreator, Throwable). The member class is not required anymore.
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

        Parameters:
        errorCode - String with the soft error type.
        memberClass - Type of the value for that soft error type.
        message - Message providing more details about the error .
        valueCreator - Function that takes a value builder to create the soft error value.
        cause - The exception that caused the soft error. May be null when not caused by any exception.
        Since:
        8.0.0
      • softError

        default void softError​(String errorCode,
                               String message,
                               IValueCreator valueCreator)
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

        Parameters:
        errorCode - String with the soft error type.
        message - Message providing more details about the error .
        valueCreator - Function that takes a value builder to create the soft error value.
        Since:
        8.0.0
      • softError

        default void softError​(String errorCode,
                               String message,
                               IValueCreator valueCreator,
                               Throwable cause)
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

        Parameters:
        errorCode - String with the soft error type.
        message - Message providing more details about the error .
        valueCreator - Function that takes a value builder to create the soft error value.
        cause - The exception that caused the soft error. May be null when not caused by any exception.
        Since:
        8.1.0
      • softError

        default void softError​(String errorCode,
                               String message,
                               Object value)
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

        Parameters:
        errorCode - String with the error type.
        message - Message providing more details about the error .
        value - Value with details about the error.
        Since:
        8.0.0
      • softError

        default void softError​(String errorCode,
                               String message,
                               Object value,
                               Throwable cause)
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

        Parameters:
        errorCode - String with the error type.
        message - Message providing more details about the error .
        value - Value with details about the error.
        cause - The exception that caused the soft error. May be null when not caused by any exception.
        Since:
        8.0.0
      • softError

        void softError​(String message,
                       Throwable cause,
                       Consumer<IUnionValueBuilder<String>> errorValue)
        Adds a soft error to the list of soft errors. The soft error added via this method is always automatically included in the success result of the node, in addition to the soft errors already present in the success result. Compare with INormalCompletionResultBuilder#softError, which only adds the error when that builder is used.

        When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. See softErrors for more details.

         // Adds a soft error with no additional data.
         builder.softError("bad data", b -> b.value("FOUND_BAD_DATA", new HashMap<>()));
         
        Parameters:
        message - Message providing more details about the error .
        errorValue - Function that takes a value builder to create the error value.
        cause - The exception that caused the soft error. May be null when not caused by any exception.
        Since:
        8.0.0
      • standardFileErrorsMultiple

        IResolvedFileListProcessor<List<IResolvedFile>,​NodeThrewException> standardFileErrorsMultiple​(boolean required)
        Returns a IResolvedFileListProcessor that can be used with IResolvedFileList#collectResult. The processor implements the standard error behavior for resolved files, see standardFileErrorsMultiple for more details.

        This method uses the standard error codes NETWORK_ERROR (hard error), DATABASE_ERROR (hard error), FILE_SYSTEM_ERROR (hard error), and NO_SOURCE_FILE_FOUND (hard + soft error). You should make sure that your action includes these error codes in the error value descriptor and soft error value descriptor. See CodeOnlyStandardFileListResolutionErrorCreator for more details.

        Furthermore, this method uses the standard error codes NETWORK_ERROR (hard error), DATABASE_ERROR (hard error), FILE_SYSTEM_ERROR (hard error), and NO_SOURCE_FILE_FOUND (hard and soft error). You should make sure that your action includes these error codes in the error value descriptor and soft error value descriptor. See CodeOnlyStandardFileListResolutionErrorCreator for more details.

        If you need more customization, extend the StandardErrorFileListProcessor or use a custom implementation of IResolvedFileListProcessor.

        Parameters:
        required - Whether at least one file must be present. When true, an error is issued to the handler when not at least one file was found.
        Returns:
        A processor that collects the resolved resource items into a list of all files.
      • standardFileErrorsSingle

        IResolvedFileListProcessor<Optional<IResolvedFile>,​NodeThrewException> standardFileErrorsSingle​(boolean required)
        Returns a IResolvedFileListProcessor that can be used with IResolvedFileList#collectResult. The processor implements the standard error behavior for resolved files, see standardFileErrorsSingle for more details.

        This method uses the standard error codes NETWORK_ERROR (hard error), DATABASE_ERROR (hard error), FILE_SYSTEM_ERROR (hard error), and NO_SOURCE_FILE_FOUND (hard + soft error). You should make sure that your action includes these error codes in the error value descriptor and soft error value descriptor. See CodeOnlyStandardFileListResolutionErrorCreator for more details.

        If you need more customization, extend the StandardErrorFileListProcessor or use a custom implementation of IResolvedFileListProcessor.

        Parameters:
        required - Whether at least one file must be present. When true, an error is issued to the handler when not at least one file was found.
        Returns:
        A processor that collects the resolved resource items into an optional with the first resolved file.
      • throwingException

        INodeThrewExceptionBuilder throwingException()
        When the node was executed, but an exception did occur, use this method to create a throwing exception and throw it. Please note that if you just throw some exception, it will be wrapped in a NodeThrewException.
        Returns:
        A builder for a throwing exception.
      • transferringControlException

        INodeTransferredControlExceptionBuilder transferringControlException​(String controlTransferType)
        When the node was executed, and you wish to break the execution of an ongoing loop via a break statement, create a breaking loop exception with this method and throw it.
        Parameters:
        controlTransferType - Type of the abrupt local control transfer, see EStandardControlTransferType for a list of built-in transfer types.
        Returns:
        A builder for a breaking loop exception.