Class StandardErrorAttachmentListProcessor<R>
- java.lang.Object
-
- de.xima.fc.workflow.processor.logic.execution.StandardErrorAttachmentListProcessor<R>
-
- Type Parameters:
R
- Type of the combined result of all attachment items.
- All Implemented Interfaces:
IResolvedAttachmentListProcessor<R,NodeThrewException>
public class StandardErrorAttachmentListProcessor<R> extends Object implements IResolvedAttachmentListProcessor<R,NodeThrewException>
Standard implementation forIResolvedAttachmentListProcessor
with the standard error behavior used by most built-in actions.This class is designed to be extended, you can override all
on*
methods to customize the behavior for a specific error case. These methods may use theerrorCreator
to create the error data. Thecollector()
method returns the collector that was passed to the constructor.The default 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 attachments could not be read from the attachment system or written to the attachment 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.
- Since:
- 8.1.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description protected Collector<? super IResolvedAttachmentItem,?,R>
collector
protected IStandardAttachmentListResolutionErrorCreator
errorCreator
protected INodeExecutionParams<?>
params
protected boolean
required
-
Constructor Summary
Constructors Constructor Description StandardErrorAttachmentListProcessor(INodeExecutionParams<?> params, Collector<? super IResolvedAttachmentItem,?,R> collector, IStandardAttachmentListResolutionErrorCreator errorCreator, boolean required)
-
Method Summary
-
-
-
Field Detail
-
collector
protected final Collector<? super IResolvedAttachmentItem,?,R> collector
-
errorCreator
protected final IStandardAttachmentListResolutionErrorCreator errorCreator
-
params
protected final INodeExecutionParams<?> params
-
required
protected final boolean required
-
-
Constructor Detail
-
StandardErrorAttachmentListProcessor
public StandardErrorAttachmentListProcessor(INodeExecutionParams<?> params, Collector<? super IResolvedAttachmentItem,?,R> collector, IStandardAttachmentListResolutionErrorCreator errorCreator, boolean required)
- Parameters:
params
- Node execution parameters for the currently executed node.collector
- Collector as returned bycollector()
.errorCreator
- Error creator that is used to produce the error code and error data for the soft and hard workflow node errors.required
- Whether at least one attachment is required. Whentrue
and no attachments are present, an error is thrown.
-
-
Method Detail
-
collector
public final Collector<? super IResolvedAttachmentItem,?,R> collector()
- Specified by:
collector
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Returns:
- Collector that combines all attachment items into the final result.
-
onAttachmentCountReducedToZeroByFilter
public void onAttachmentCountReducedToZeroByFilter(AAttachmentListResolutionError.AttachmentCountReducedToZeroByFilter error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.ATTACHMENT_COUNT_REDUCED_TO_ZERO_BY_FILTER_OPTIONS
.- Specified by:
onAttachmentCountReducedToZeroByFilter
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onAttachmentQueryDoesNotMatch
public void onAttachmentQueryDoesNotMatch(AAttachmentListResolutionError.AttachmentQueryDoesNotMatch error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.ATTACHMENT_QUERY_DOES_NOT_MATCH
.- Specified by:
onAttachmentQueryDoesNotMatch
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onCannotProcessAttachmentItem
public void onCannotProcessAttachmentItem(AAttachmentListResolutionError.CannotProcessAttachmentItem error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.CANNOT_PROCESS_ATTACHMENT_ITEM
.- Specified by:
onCannotProcessAttachmentItem
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onCannotProcessAttachmentList
public void onCannotProcessAttachmentList(AAttachmentListResolutionError.CannotProcessAttachmentList error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.CANNOT_PROCESS_ATTACHMENT_LIST
.- Specified by:
onCannotProcessAttachmentList
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onDatabaseError
public void onDatabaseError(AAttachmentListResolutionError.DatabaseError error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.DATABASE_ERROR
.- Specified by:
onDatabaseError
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onFileSystemError
public void onFileSystemError(AAttachmentListResolutionError.FileSystemError error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.FILE_SYSTEM_ERROR
.- Specified by:
onFileSystemError
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onNodeDoesNotExist
public void onNodeDoesNotExist(AAttachmentListResolutionError.NodeDoesNotExist error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.NODE_DOES_NOT_EXIST
.- Specified by:
onNodeDoesNotExist
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onNodeDoesNotProvideAttachments
public void onNodeDoesNotProvideAttachments(AAttachmentListResolutionError.NodeDoesNotProvideAttachments error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.NODE_DOES_NOT_PROVIDE_ATTACHMENTS
.- Specified by:
onNodeDoesNotProvideAttachments
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onNodeNotExecuted
public void onNodeNotExecuted(AAttachmentListResolutionError.NodeNotExecuted error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.NODE_NOT_EXECUTED
.- Specified by:
onNodeNotExecuted
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onResolvedAttachmentListEmpty
public void onResolvedAttachmentListEmpty() throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback when all attachment items were resolved and not a single attachment was found.- Specified by:
onResolvedAttachmentListEmpty
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Throws:
NodeThrewException
-
onUploadFieldDoesNotExist
public void onUploadFieldDoesNotExist(AAttachmentListResolutionError.UploadFieldDoesNotExist error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.UPLOAD_FIELD_DOES_NOT_EXIST
.- Specified by:
onUploadFieldDoesNotExist
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onUploadFieldDoesNotProvideAttachments
public void onUploadFieldDoesNotProvideAttachments(AAttachmentListResolutionError.UploadFieldDoesNotProvideAttachments error) throws NodeThrewException
Description copied from interface:IResolvedAttachmentListProcessor
Callback for handling an error of typeEAttachmentItemResolutionError.UPLOAD_FIELD_DOES_NOT_PROVIDE_ATTACHMENTS
.- Specified by:
onUploadFieldDoesNotProvideAttachments
in interfaceIResolvedAttachmentListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
-