Interface INodeExecutionParams<TData>

    • Method Detail

      • 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.
      • 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

        default <T> void softError​(String errorCode,
                                   Class<T> memberClass,
                                   String message,
                                   IValueCreator<T> 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.
        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 <T> void softError​(String errorCode,
                                   Class<T> memberClass,
                                   String message,
                                   IValueCreator<T> 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.
        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

        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

        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

        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.
      • standardFileErrorsMultiple

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

        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.

        The standard error behavior is as follows:

        Furthermore, the following errors can occur, irrespective of the resource item type:
        • A soft NoSourceFileFound is produced when at least one resolved file was found for a resource item, but the additional filter excluded all those files.
        • A hard FileSystem is thrown when files could not be read from the file system or written to the file system.
        • A hard DatabaseError is thrown when an error occurred during the communication with the database.
        • A hard General error is thrown when an unexpected error occurred that could not be handled otherwise.
        The error codes and error data for each error type is taken from the provided errorCreator.
        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.
        errorCreator - Instance that provides the error code and error data for each predefined standard file resolution error.
        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.
      • standardFileErrorsSingle

        IResolvedFileListProcessor<Optional<IResolvedFile>,​NodeThrewException> standardFileErrorsSingle​(boolean required,
                                                                                                              IStandardFileListResolutionErrorCreator errorCreator)
        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.

        The standard error behavior is as follows:

        Furthermore, the following errors can occur, irrespective of the resource item type:
        • A soft NoSourceFileFound is produced when at least one resolved file was found for a resource item, but the additional filter excluded all those files.
        • A hard FileSystem is thrown when files could not be read from the file system or written to the file system.
        • A hard DatabaseError is thrown when an error occurred during the communication with the database.
        • A hard General error is thrown when an unexpected error occurred that could not be handled otherwise.
        The error codes and error data for each error type is taken from the provided errorCreator.
        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.
        errorCreator - Instance that provides the error code and error data for each predefined standard file resolution error.
        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.