Interface INodeExecutionParams<Model>

Type Parameters:
Model - Type of the properties model for the node. See INodeHandler.

public interface INodeExecutionParams<Model>
Interface for the parameters that are passed to INodeHandler.execute(INodeExecutionParams).
Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Method Details

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

      Model getData()
      Returns:
      The custom data of the given node. This is passed for convenience, it the same as AWorkflowElement.getCustomParameters(), but already deserialized and updated.
    • 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

      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> ignoredMemberClass, 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.
      ignoredMemberClass - Unused.
      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> ignoredMemberClass, 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.
      ignoredMemberClass - Unused.
      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

      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

      @Deprecated void softError(String message, Throwable cause, Consumer<IUnionValueBuilder> 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 .
      cause - The exception that caused the soft error. May be null when not caused by any exception.
      errorValue - Function that takes a value builder to create the error value.
      Since:
      8.0.0
    • standardAttachmentErrorsMultiple

      IResolvedAttachmentListProcessor<List<IResolvedAttachment>, NodeThrewException> standardAttachmentErrorsMultiple(boolean required)
      Returns a IResolvedAttachmentListProcessor that can be used with IResolvedAttachmentList#collectResult. The processor implements the standard error behavior for resolved attachments, see standardAttachmentErrorsMultiple for more details.

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

      If you need more customization, extend the StandardErrorAttachmentListProcessor or use a custom implementation of IResolvedAttachmentListProcessor.

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

      Returns a IResolvedAttachmentListProcessor that can be used with IResolvedAttachmentList#collectResult. The processor implements the standard error behavior for resolved attachments, see below.

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

      If you need more customization, extend the StandardErrorAttachmentListProcessor or use a custom implementation of IResolvedAttachmentListProcessor.

      The standard error behavior is as follows:

      Furthermore, the following errors can occur, irrespective of the attachment item type:
      • A soft NoSourceAttachmentFound is produced when at least one resolved attachment was found for an attachment item, but the additional filter excluded all those attachments.
      • 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 attachment must be present. When true, an error is issued to the handler when not at least one attachment was found.
      errorCreator - Instance that provides the error code and error data for each predefined standard attachment resolution error.
      Returns:
      A processor that collects the resolved attachment items into a list of all attachments.
      Since:
      8.1.0
    • standardAttachmentErrorsSingle

      IResolvedAttachmentListProcessor<Optional<IResolvedAttachment>, NodeThrewException> standardAttachmentErrorsSingle(boolean required)
      Returns a IResolvedAttachmentListProcessor that can be used with IResolvedAttachmentList#collectResult. The processor implements the standard error behavior for resolved attachments, see standardAttachmentErrorsSingle for more details.

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

      If you need more customization, extend the StandardErrorAttachmentListProcessor or use a custom implementation of IResolvedAttachmentListProcessor.

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

      Returns a IResolvedAttachmentListProcessor that can be used with IResolvedAttachmentList#collectResult. The processor implements the standard error behavior for resolved attachments.

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

      If you need more customization, extend the StandardErrorAttachmentListProcessor or use a custom implementation of IResolvedAttachmentListProcessor.

      The standard error behavior is as follows:

      Furthermore, the following errors can occur, irrespective of the attachment item type:
      • A soft NoSourceAttachmentFound is produced when at least one resolved attachment was found for an attachment item, but the additional filter excluded all those attachments.
      • 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 attachment must be present. When true, an error is issued to the handler when not at least one attachment was found.
      errorCreator - Instance that provides the error code and error data for each predefined standard attachment resolution error.
      Returns:
      A processor that collects the resolved attachment items into an optional with the first resolved attachment.
      Since:
      8.1.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 descriptors and soft error value descriptors. 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 descriptors and soft error value descriptors. 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 descriptors and soft error value descriptors. 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

      Returns a IResolvedFileListProcessor that can be used with IResolvedFileList#collectResult.

      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 descriptors and soft error value descriptors. 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.
    • standardFileProvisionErrorProcessor

      IFileProvisionHandleErrorProcessor<NodeThrewException> standardFileProvisionErrorProcessor()
      Default processor for errors that occur during IWorkflowFileHandler#handleFileProvision.

      This processor uses the standard error codes DATABASE_ERROR (hard error) and FILE_SYSTEM_ERROR (hard error). You should make sure that your action includes these error codes in the error value descriptors and soft error value descriptors.

      Returns:
      Default error processor for file provision.
    • standardFileProvisionOptions

      IFileProvisionOptions<NodeThrewException> standardFileProvisionOptions()
      Default options for IWorkflowFileHandler#handleFileProvision. Uses the standard error processor, see there for more details regarding the error codes you need to define.
      Returns:
      Default options for file provision.
    • 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.