Class ResolvedAttachmentList
java.lang.Object
de.xima.fc.workflow.processor.model.ResolvedAttachmentList
- All Implemented Interfaces:
IAttachmentItemResolutionErrorProviding,IResolvedAttachmentList
Default POJO implementation of
IResolvedAttachmentList.- Since:
- 8.1.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescription<R,E extends Throwable>
RcollectResult(IResolvedAttachmentListProcessor<R, E> handler) Iterates over all resolved attachment items, processes them with the given handler, and returns the combined result of all attachment items.Retrieves the list of resolved attachment items.static IResolvedAttachmentListCreates a new POJO with the given data and no containing directory and attachments.static IResolvedAttachmentListofSuccess(IReferencedAttachmentList attachmentList, List<IResolvedAttachmentItem> resourceItems) Creates a new POJO with the given data and thegetErrors()set tonull.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.interfaces.workflow.retval.IAttachmentItemResolutionErrorProviding
getErrors, getErrorsAttachmentCountReducedTozeroByFilterOptions, getErrorsAttachmentFilterDoesNotMatch, getErrorsCannotProcessAttachmentItem, getErrorsCannotProcessAttachmentList, getErrorsDatabaseError, getErrorsFileSystemError, getErrorsNodeDoesNotExist, getErrorsNodeDoesNotProvideAttachments, getErrorsNodeNotExecuted, getErrorsUploadFieldDoesNotExist, getErrorsUploadFieldDoesNotProvideAttachments, isHasErrorMethods inherited from interface de.xima.fc.interfaces.workflow.retval.IResolvedAttachmentList
getResolvedAttachmentsComplete, getResolvedAttachmentsPartial
-
Method Details
-
collectResult
public <R,E extends Throwable> R collectResult(IResolvedAttachmentListProcessor<R, E> handler) throws EDescription copied from interface:IResolvedAttachmentListIterates over all resolved attachment items, processes them with the given handler, and returns the combined result of all attachment items. Standard use case is to convert errors to hard and soft workflow node errors and return a list of all resolved attachments.If you wish to use the standard error behavior for attachments, use
standardAttachmentErrorsSingleorstandardAttachmentErrorsMultiple. Otherwise, provide your own processor implementation, or extend theStandardErrorAttachmentListProcessor.- Specified by:
collectResultin interfaceIResolvedAttachmentList- Type Parameters:
R- Type of the combined result of all attachment items.E- Type of the error that may be thrown when anyerrorsare present.- Parameters:
handler- Handler for processing the errors and the results.- Returns:
- The combined result of all attachment items.
- Throws:
E- The first error thrown by the handler.
-
getErrors
- Specified by:
getErrorsin interfaceIAttachmentItemResolutionErrorProviding- Returns:
- All errors that occurred during the attachment item's resolution.
-
getAttachmentList
- Specified by:
getAttachmentListin interfaceIResolvedAttachmentList- Returns:
- The attachment list that was resolved to obtain this result.
-
getAttachmentItems
Description copied from interface:IResolvedAttachmentListRetrieves the list of resolved attachment items. This list always contains one entry for eachAttachmentItemthat was passed toresolveReferencedAttachments, independent of whether any exceptions occurred while resolving that item. WhenIAttachmentItemResolutionErrorProviding.getErrors()is notnull, this list is empty.- Specified by:
getAttachmentItemsin interfaceIResolvedAttachmentList- Returns:
- A list with the resolved attachments.
-
ofError
public static IResolvedAttachmentList ofError(AAttachmentListResolutionError.CannotProcessAttachmentList error) Creates a new POJO with the given data and no containing directory and attachments.- Parameters:
error- Value as returned bygetErrors().- Returns:
- New resolved attachment list for the given error.
-
ofSuccess
public static IResolvedAttachmentList ofSuccess(IReferencedAttachmentList attachmentList, List<IResolvedAttachmentItem> resourceItems) Creates a new POJO with the given data and thegetErrors()set tonull.- Parameters:
attachmentList- Original attachment list that was processed.resourceItems- Value as returned bygetAttachmentItems().- Returns:
- New resolved attachment list for the given resolved items.
-