Interface INodeExecutionParams<Model>
-
- Type Parameters:
Model
- Type of the properties model for the node. SeeINodeHandler
.
public interface INodeExecutionParams<Model>
Interface for the parameters that are passed toINodeHandler.execute(INodeExecutionParams)
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
-
-
-
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.
-
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
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 forcurrentValue()
. 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.UsesoftError(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 withINormalCompletionResultBuilder#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.usesoftError(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 withINormalCompletionResultBuilder#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 benull
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 withINormalCompletionResultBuilder#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 withINormalCompletionResultBuilder#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 benull
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 withINormalCompletionResultBuilder#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 withINormalCompletionResultBuilder#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 benull
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 withINormalCompletionResultBuilder#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 benull
when not caused by any exception.- Since:
- 8.0.0
-
standardAttachmentErrorsMultiple
IResolvedAttachmentListProcessor<List<IResolvedAttachment>,NodeThrewException> standardAttachmentErrorsMultiple(boolean required)
Returns aIResolvedAttachmentListProcessor
that can be used withIResolvedAttachmentList#collectResult
. The processor implements the standard error behavior for resolved attachments, seestandardAttachmentErrorsMultiple
for more details.This method uses the standard error codes
DATABASE_ERROR
(hard error),FILE_SYSTEM_ERROR
(hard error), andNO_SOURCE_ATTACHMENT_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardAttachmentListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorAttachmentListProcessor
or use a custom implementation ofIResolvedAttachmentListProcessor
.- Parameters:
required
- Whether at least one attachment must be present. Whentrue
, 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
IResolvedAttachmentListProcessor<List<IResolvedAttachment>,NodeThrewException> standardAttachmentErrorsMultiple(boolean required, IStandardAttachmentListResolutionErrorCreator errorCreator)
Returns aIResolvedAttachmentListProcessor
that can be used withIResolvedAttachmentList#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), andNO_SOURCE_ATTACHMENT_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardAttachmentListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorAttachmentListProcessor
or use a custom implementation ofIResolvedAttachmentListProcessor
.The standard error behavior is as follows:
Form record attachment query
: Soft errorNoSourceAttachmentFound
when not a single attachment was found.Attachments from previously executed node
: Hard errorNoSourceAttachmentFound
when the referenced node does not exist in the workflow, soft errorNoSourceAttachmentFound
when the node was not executed or does not provide any attachments.Uploads
: Hard errorNoSourceAttachmentFound
when the referenced upload element does not exist in the workflow, soft errorNoSourceAttachmentFound
when no attachment exists for the referenced upload element.
- A soft
NoSourceAttachmentFound
is produced when at least one resolved attachment was found for an attachment item, but the additionalfilter
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.
errorCreator
.- Parameters:
required
- Whether at least one attachment must be present. Whentrue
, 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 aIResolvedAttachmentListProcessor
that can be used withIResolvedAttachmentList#collectResult
. The processor implements the standard error behavior for resolved attachments, seestandardAttachmentErrorsSingle
for more details.This method uses the standard error codes
DATABASE_ERROR
(hard error),FILE_SYSTEM_ERROR
(hard error), andNO_SOURCE_ATTACHMENT_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardAttachmentListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorAttachmentListProcessor
or use a custom implementation ofIResolvedAttachmentListProcessor
.- Parameters:
required
- Whether at least one attachment must be present. Whentrue
, 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
IResolvedAttachmentListProcessor<Optional<IResolvedAttachment>,NodeThrewException> standardAttachmentErrorsSingle(boolean required, IStandardAttachmentListResolutionErrorCreator errorCreator)
Returns aIResolvedAttachmentListProcessor
that can be used withIResolvedAttachmentList#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), andNO_SOURCE_ATTACHMENT_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardAttachmentListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorAttachmentListProcessor
or use a custom implementation ofIResolvedAttachmentListProcessor
.The standard error behavior is as follows:
Form record attachment query
: Soft errorNoSourceAttachmentFound
when not a single attachment was found.Attachments from previously executed node
: Hard errorNoSourceAttachmentFound
when the referenced node does not exist in the workflow, soft errorNoSourceAttachmentFound
when the node was not executed or does not provide any attachments.Uploads
: Hard errorNoSourceAttachmentFound
when the referenced upload element does not exist in the workflow, soft errorNoSourceAttachmentFound
when no attachment exists for the referenced upload element.
- A soft
NoSourceAttachmentFound
is produced when at least one resolved attachment was found for a attachment item, but the additionalfilter
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.
errorCreator
.- Parameters:
required
- Whether at least one attachment must be present. Whentrue
, 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 aIResolvedFileListProcessor
that can be used withIResolvedFileList#collectResult
. The processor implements the standard error behavior for resolved files, seestandardFileErrorsMultiple
for more details.This method uses the standard error codes
NETWORK_ERROR
(hard error),DATABASE_ERROR
(hard error),FILE_SYSTEM_ERROR
(hard error), andNO_SOURCE_FILE_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardFileListResolutionErrorCreator
for more details.Furthermore, this method uses the standard error codes
NETWORK_ERROR
(hard error),DATABASE_ERROR
(hard error),FILE_SYSTEM_ERROR
(hard error), andNO_SOURCE_FILE_FOUND
(hard and soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardFileListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorFileListProcessor
or use a custom implementation ofIResolvedFileListProcessor
.- Parameters:
required
- Whether at least one file must be present. Whentrue
, 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 aIResolvedFileListProcessor
that can be used withIResolvedFileList#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), andNO_SOURCE_FILE_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardFileListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorFileListProcessor
or use a custom implementation ofIResolvedFileListProcessor
.The standard error behavior is as follows:
Form record attachment query
: Soft errorNoSourceFileFound
when not a single attachment was found.Referenced client file
: Hard errorNoSourceFileFound
when the referenced client file with the UUID does not exist in the system.Network resource
: Hard errorNetworkError
when either the URL is invalid or the data cannot be read from the network.Files from previously executed node
: Hard errorNoSourceFileFound
when the referenced node does not exist in the workflow, soft errorNoSourceFileFound
when the node was not executed or does not provide any files.Files from fired triggers
: Hard errorNoSourceFileFound
when the referenced trigger does not exist in the workflow, soft errorNoSourceFileFound
when the trigger did not fire or does not provide any files.Referenced form file
: Hard errorNoSourceFileFound
when the referenced form file with the UUID does not exist in the system.Uploads
: Hard errorNoSourceFileFound
when the referenced upload element does not exist in the workflow, soft errorNoSourceFileFound
when no attachment exists for the referenced upload element.
- A soft
NoSourceFileFound
is produced when at least one resolved file was found for a resource item, but the additionalfilter
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.
errorCreator
.- Parameters:
required
- Whether at least one file must be present. Whentrue
, 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 aIResolvedFileListProcessor
that can be used withIResolvedFileList#collectResult
. The processor implements the standard error behavior for resolved files, seestandardFileErrorsSingle
for more details.This method uses the standard error codes
NETWORK_ERROR
(hard error),DATABASE_ERROR
(hard error),FILE_SYSTEM_ERROR
(hard error), andNO_SOURCE_FILE_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardFileListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorFileListProcessor
or use a custom implementation ofIResolvedFileListProcessor
.- Parameters:
required
- Whether at least one file must be present. Whentrue
, 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 aIResolvedFileListProcessor
that can be used withIResolvedFileList#collectResult
.This method uses the standard error codes
NETWORK_ERROR
(hard error),DATABASE_ERROR
(hard error),FILE_SYSTEM_ERROR
(hard error), andNO_SOURCE_FILE_FOUND
(hard + soft error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
. SeeCodeOnlyStandardFileListResolutionErrorCreator
for more details.If you need more customization, extend the
StandardErrorFileListProcessor
or use a custom implementation ofIResolvedFileListProcessor
.The standard error behavior is as follows:
Form record attachment query
: Soft errorNoSourceFileFound
when not a single attachment was found.Referenced client file
: Hard errorNoSourceFileFound
when the referenced client file with the UUID does not exist in the system.Network resource
: Hard errorNetworkError
when either the URL is invalid or the data cannot be read from the network.Files from previously executed node
: Hard errorNoSourceFileFound
when the referenced node does not exist in the workflow, soft errorNoSourceFileFound
when the node was not executed or does not provide any files.Files from fired triggers
: Hard errorNoSourceFileFound
when the referenced trigger does not exist in the workflow, soft errorNoSourceFileFound
when the trigger did not fire or does not provide any files.Referenced form file
: Hard errorNoSourceFileFound
when the referenced form file with the UUID does not exist in the system.Uploads
: Hard errorNoSourceFileFound
when the referenced upload element does not exist in the workflow, soft errorNoSourceFileFound
when no attachment exists for the referenced upload element.
- A soft
NoSourceFileFound
is produced when at least one resolved file was found for a resource item, but the additionalfilter
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.
errorCreator
.- Parameters:
required
- Whether at least one file must be present. Whentrue
, 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 duringIWorkflowFileHandler#handleFileProvision
.This processor uses the standard error codes
DATABASE_ERROR
(hard error) andFILE_SYSTEM_ERROR
(hard error). You should make sure that your action includes these error codes in theerror value descriptor
andsoft error value descriptor
.- Returns:
- Default error processor for file provision.
-
standardFileProvisionOptions
IFileProvisionOptions<NodeThrewException> standardFileProvisionOptions()
Default options forIWorkflowFileHandler#handleFileProvision
. Uses thestandard 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 aNodeThrewException
.- 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, seeEStandardControlTransferType
for a list of built-in transfer types.- Returns:
- A builder for a breaking loop exception.
-
-