Class StandardErrorFileListProcessor<R>
- java.lang.Object
-
- de.xima.fc.workflow.processor.logic.execution.StandardErrorFileListProcessor<R>
-
- Type Parameters:
R
- Type of the combined result of all resource items.
- All Implemented Interfaces:
IResolvedFileListProcessor<R,NodeThrewException>
public class StandardErrorFileListProcessor<R> extends Object implements IResolvedFileListProcessor<R,NodeThrewException>
Standard implementation forIResolvedFileListProcessor
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 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.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.
- Since:
- 7.1.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description protected Collector<? super IResolvedResourceItem,?,R>
collector
protected IStandardFileListResolutionErrorCreator
errorCreator
protected INodeExecutionParams<?>
params
protected boolean
required
-
Constructor Summary
Constructors Constructor Description StandardErrorFileListProcessor(INodeExecutionParams<?> params, Collector<? super IResolvedResourceItem,?,R> collector, IStandardFileListResolutionErrorCreator errorCreator, boolean required)
-
Method Summary
-
-
-
Field Detail
-
collector
protected final Collector<? super IResolvedResourceItem,?,R> collector
-
errorCreator
protected final IStandardFileListResolutionErrorCreator errorCreator
-
params
protected final INodeExecutionParams<?> params
-
required
protected final boolean required
-
-
Constructor Detail
-
StandardErrorFileListProcessor
public StandardErrorFileListProcessor(INodeExecutionParams<?> params, Collector<? super IResolvedResourceItem,?,R> collector, IStandardFileListResolutionErrorCreator 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 file is required. Whentrue
and no files are present, an error is thrown.
-
-
Method Detail
-
collector
public final Collector<? super IResolvedResourceItem,?,R> collector()
- Specified by:
collector
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Returns:
- Collector that combines all resource items into the final result.
-
onAttachmentQueryDoesNotMatch
public void onAttachmentQueryDoesNotMatch(AFileListResolutionError.AttachmentQueryDoesNotMatch error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.ATTACHMENT_QUERY_DOES_NOT_MATCH
.- Specified by:
onAttachmentQueryDoesNotMatch
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onCannotProcessFileList
public void onCannotProcessFileList(AFileListResolutionError.CannotProcessFileList error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.CANNOT_PROCESS_FILE_LIST
.- Specified by:
onCannotProcessFileList
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onCannotProcessResourceItem
public void onCannotProcessResourceItem(AFileListResolutionError.CannotProcessResourceItem error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.CANNOT_PROCESS_RESOURCE_ITEM
.- Specified by:
onCannotProcessResourceItem
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onClientFileDoesNotExist
public void onClientFileDoesNotExist(AFileListResolutionError.ClientFileDoesNotExist error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.CLIENT_FILE_DOES_NOT_EXIST
.- Specified by:
onClientFileDoesNotExist
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onDatabaseError
public void onDatabaseError(AFileListResolutionError.DatabaseError error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.DATABASE_ERROR
.- Specified by:
onDatabaseError
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onExternalUrlCannotBeRead
public void onExternalUrlCannotBeRead(AFileListResolutionError.ExternalUrlCannotBeRead error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.EXTERNAL_URL_CANNOT_BE_READ
.- Specified by:
onExternalUrlCannotBeRead
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onExternalUrlIsSyntacticallyInvalid
public void onExternalUrlIsSyntacticallyInvalid(AFileListResolutionError.ExternalUrlIsSyntacticallyInvalid error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.EXTERNAL_URL_IS_SYNTACTICALLY_INVALID
.- Specified by:
onExternalUrlIsSyntacticallyInvalid
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onFileCountReducedToZeroByFilter
public void onFileCountReducedToZeroByFilter(AFileListResolutionError.FileCountReducedToZeroByFilter error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.FILE_COUNT_REDUCED_TO_ZERO_BY_FILTER_OPTIONS
.- Specified by:
onFileCountReducedToZeroByFilter
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onFileSystemError
public void onFileSystemError(AFileListResolutionError.FileSystemError error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.FILE_SYSTEM_ERROR
.- Specified by:
onFileSystemError
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onFormFileDoesNotExist
public void onFormFileDoesNotExist(AFileListResolutionError.FormFileDoesNotExist error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.FORM_FILE_DOES_NOT_EXIST
.- Specified by:
onFormFileDoesNotExist
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onNodeDoesNotExist
public void onNodeDoesNotExist(AFileListResolutionError.NodeDoesNotExist error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.NODE_DOES_NOT_EXIST
.- Specified by:
onNodeDoesNotExist
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onNodeDoesNotProvideFiles
public void onNodeDoesNotProvideFiles(AFileListResolutionError.NodeDoesNotProvideFiles error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.NODE_DOES_NOT_PROVIDE_FILES
.- Specified by:
onNodeDoesNotProvideFiles
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onNodeNotExecuted
public void onNodeNotExecuted(AFileListResolutionError.NodeNotExecuted error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.NODE_NOT_EXECUTED
.- Specified by:
onNodeNotExecuted
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onResolvedFileListEmpty
public void onResolvedFileListEmpty() throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback when all resource items were resolved and not a single file was found.- Specified by:
onResolvedFileListEmpty
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Throws:
NodeThrewException
-
onUploadFieldDoesNotExist
public void onUploadFieldDoesNotExist(AFileListResolutionError.UploadFieldDoesNotExist error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.UPLOAD_FIELD_DOES_NOT_EXIST
.- Specified by:
onUploadFieldDoesNotExist
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
onUploadFieldDoesNotProvideFiles
public void onUploadFieldDoesNotProvideFiles(AFileListResolutionError.UploadFieldDoesNotProvideFiles error) throws NodeThrewException
Description copied from interface:IResolvedFileListProcessor
Callback for handling an error of typeEResourceItemResolutionError.UPLOAD_FIELD_DOES_NOT_PROVIDE_FILES
.- Specified by:
onUploadFieldDoesNotProvideFiles
in interfaceIResolvedFileListProcessor<R,NodeThrewException>
- Parameters:
error
- The error that occurred.- Throws:
NodeThrewException
-
-