Interface PersistTask<A,T>
- All Known Subinterfaces:
AggregateTasks.AggregateTask<N>,CalendarEventLabelTask,CascadingDeleteService,CreateAnswerTask,CreateMovementTask,CreateOrderGeneratorBeanTask,GetRatingTask,NoArgPersistTask<T>,OptionalTask<A,,B> OrderGeneratorCheckTask,OrderGeneratorTask,PersistTaskIterable<A,,T> RetryablePersistTask<A,,T> RetryablePersistTaskIterable<A,,T> SendMailTask
- All Known Implementing Classes:
AbstractActionResource.GetFormEntityTask,AbstractAllChangesTask,AbstractCmsAllChangesTask,AbstractCollectStatesTask,AbstractCopyContentTask,AbstractCreateAnswerTask,AbstractCreateChoiceAnswerTask,AbstractDelegatingPersistTask,AbstractDmsAllChangesTask,AbstractGetNodesArgumentTask,AbstractGetSelectStatesTask,AbstractOrderGeneratorCheckTask,AbstractOrderGeneratorTask,AbstractPartitionedPersistTask,AbstractRelatedEntityPersistTask,AbstractRelatedEntityPersistTask.GetRelatedEntityPersistTask,AbstractRelatedEntityPersistTask.SetRelatedEntityPersistTask,AbstractSaveNodeRightsTask,AddContentTask,AddNodeRightsTask,AddSectionTask,AddSnippetTask,AfterCommitTask,AggregateTasks.Avg,AggregateTasks.Count,AggregateTasks.SimpleSum,AggregateTasks.Sum,AnonymizeEntityHistoryTask,BufferedSetEntityDefaultsTask,BusinessUnitIdQuery,BusinessUnitMode.BusinessUnitTask,BusinessUnitPrincipalQuery,CalculateDebitorOpenBalanceDueTask,CalendarEventLabelAvailabilityTask,CalendarEventLabelDefaultTask,CalendarEventLabelReservationTask,CancelVoucherTask,CascadeDeleteTask,CascadingDeleteServiceImpl,CheckBillingPositionsTask,CheckHostTask,CheckInvoiceRecipientsTask,CheckPriceCategoriesTask,CheckWriteAccessTask,ClearFieldsTask,CollectPageStatesTask,CollectTask,CollectWidgetStatesTask,ComposedTask,CopyAdditionalRelationsTask,CopyDataTask,CopyDataTask.CopyLecturerBookingsTask,CopyDataTask.CopyRegistrationsTask,CopyPageContentTask,CopyResourceContentTask,CopySnippetTask,CopyWidgetConfigTask,CreateAnswerTask,CreateBalanceDunningVoucherTask,CreateCalendarEventTask,CreateConsolidatableVoucherTask,CreateCorrespondenceTask,CreateDebitorTask,CreateDunningLevelTask,CreateDunningRunPersistTask,CreateEntityDocumentsFolderPersistTask,CreateHeaderTask,CreateMailArchiveAttachmentTask,CreateMailArchiveEntryTask,CreateMembershipTask,CreateMergedOutputJobTask,CreateMultipleChoiceAnswerTask,CreateOrderPositionsTask,CreateOrderRateTask,CreateOrdersTask,CreateOrderTask,CreateOutputJobItemPersistTask,CreateOutputJobPersistTask,CreatePrepaymentTask,CreatePreviewTask,CreatePrincipalTask,CreateReservationBodyTask,CreateResourcePersistTask,CreateSingleChoiceAnswerTask,CreateTeamMemberTask,CreateTextAnswerTask,CreateTrainerBodyTask,CreateVoucherForIncomingPaymentTask,CreateVouchersTask,CreateWageTask,CreateWidgetConfigTask,CreateWidgetRecordTask,DebitorDunningCompensationTask,DebitorTotalsTask,DefaultCreateMovementTask,DefaultCreateOrderGeneratorBeanTask,DefaultGetRatingTask,DeleteCaseDocuments,DeleteRelationsTask,DeleteSectionTask,DeleteTask,DuplicateContentTask,DuplicatePageContentTask,DuplicateResourceContentTask,DuplicateSectionTask,EbillRecipientValidationTask,EmailRelationConfigTask,EntityListTask,EntityLoadTask,EntityTemplateTasks.CachedTask,EntityTemplateTasks.FindTemplate,EntityTemplateTasks.LoadRelationsTask,EntityTemplateTasks.TemplateEnityCreator,EntityTemplateTasks.TemplateEntityFiller,EntityTemplateTasks.TemplateEntityMapper,EntityTemplateTasks.TemplateEntityToUri,EvaluateQuestionnaireLabelTask,EvaluateSourceDefaultDisplayTask,EvaluationTask,EventRegistrationModuleTask,EventRegistrationQuestionsTask,EventRegistrationResponsibleTask,EventRegistrationTask,EventRegistrationUserTask,ExecuteStatusProviderTask,ExpandedTask,FilterTask,FindEntitiesToDetermineLocationTask,FindLogEntryTask,FindLogEntryTask.Transform,GenerateAddressOutputTask,GenerateEvaluationExecutionsTask,GenerateFreemarkerTask,GenerateOutputJobTask,GetAllRelatedEntities,GetAvailablePermissionsForNodeTask,GetClientVersionsTask,GetContentStatesForContentToSectionTask,GetCustomerTask,GetDateForConditionTask,GetDefaultLanguageTask,GetDirectOfftimeEventsTask,GetEditContentTask,GetEmptyFieldsAndRelationsTask,GetEmptyFieldsTask,GetEmptyRelationsTask,GetEventModuleDataTask,GetExistingAnswerTask,GetIntervalCountOfftimeEventsTask,GetIntervalUntilOfftimeEventsTask,GetLocaleFromLanguageRelationTask,GetMemoryInfoTask,GetNodesArgumentTask,GetOneRelatedEntity,GetOrCreateEntityDocumentsFolderPersistTask,GetPageContentTask,GetPidTask,GetPriceTask,GetProgressOfRunningTasksTask,GetPublishedContentTask,GetQuestionAsMapTask,GetQuestionAsStringTask,GetRecursiveNodesArgumentTask,GetRelatedEntityTask,GetRelationOnExecutionByEntityNameTask,GetRelationOnExecutionTask,GetRequirementPersistTask,GetRolesTask,GetSelectedPageStatesTask,GetSelectedTask,GetSelectedWidgetStatesTask,GetSinglePrincipal,GetSnippetsTask,GetSurveyAsMapTask,GetTimingInfoTask,InheritIncomeTask,InitNodeRightsTask,InsertSnippetTask,JsonTreeTask,ListUnitRoleQuery,LoadArticleTask,LoginTask,LoginUserEntityTask,LookupTask,MembershipCheckPriceCategoriesTask,MembershipSetPriceCategoryTask,MergeOrderPositionsTask,MergeOrdersTask,MinimalPresenceCreateEntityListener.ReservationRegistrationCreatePersistTask,ModifyFieldsTask,ModifyRelationsTask,MoveSectionTask,NewLecturerBookingTask,NoTaskDataPartitionedPersistTask,OptionalTask,OrderGeneratorDummyCheckTask,OrderGeneratorDummyTask,PartitionedTask,PathInfoTask,PathValidationTask,PersistListTask,PersistTaskBase,PileImportTask,PostfinanceRecipientLookupTask,PrepareLecturerBookingTask,PreprocessFreemarkerTemplateTask,PrincipalTasks.PrincipalConverter,PrincipalTasks.PrincipalDetailsConverter,PrincipalTasks.PrincipalFieldSetter,PrincipalTasks.RoleConverter,ProcessContingentTask,ProcessFreemarkerTemplatesOnCorrespondenceTask,ProcessMovementTask,ProcessReservationRegistrationTask,PublishAllPageContentTask,PublishAllResourceContentTask,PublishPageContentTask,PublishResourceContentTask,PublishResourceWithoutKeyContentTask,PublishSnippetsOfPublishedPageTask,PublishSnippetTask,QueryTask,RebindEntityTask,RebindUserAndAddressTask,RecursiveGetChildNodesTask,RelateParentEventsTask,RelateSourceEventsTask,RemoveDebitorExportTask,RemoveNodeRightsTask,RemoveParallelEventTask,RemoveParentEventsTask,RenderTemplateBodyTask,ReplaceMailArchiveAttachmentLinksTask,RequireKeyAsStringTask,RequirementStatusUpdatesPersistTask,ResetRelationTask,RevertAllChangesTask,RevertAllChangesTask,RevertChangesTask,RevertChangesTask,RevertSnippetTask,RowImportTask,RunAsTask,RunOrderStrategiesTask,SaveDocumentPersistTask,SaveLogEntryTask,SaveOutputJobTask,SaveRequirementEvaluationPersistTask,SaveSerialCorrespondenceTask,SelectTask,SendEventRegistrationMailTask,SetChangedStatusTask,SetCorrespondenceTemplateTask,SetDebitorClearingTask,SetDebitorPaymentStatusTask,SetDefaultSalaryTask,SetDefaultsTask,SetGeoLocationTask,SetMaturityDateOnDebitorTask,SetNodeRightsTask,SetRateMaturityDateTask,SetRatingOnDebitorInformationTask,SetSectionVisibilitiesTask,SetServiceDatesTask,SetUncompletedTaskExecutionsToStoppedTask,SetupEnvironmentTask,SplitOrderTask,StatusToccoTask,Tasks.GetTaskExecutionTask,ToBusinessUnit,UidsearchTask,UnpublishAllPageContentTask,UnpublishAllResourceContentTask,UnpublishContentTask,UnsupportedPublishStatusTask,UpdateContractDatesTask,UpdateProcessingStatusTask,UpdateProgressTask,UpdateSectionTask,UpdateStartDateTask,UpdateTaskExecutionStatusTask,UserEventRegistrationQuestionsTask,ValidateEntityTask,WriteLinkageTask,WriteNonFormDataTask,ZipEntryImportTask,ZipEntryImportTask
public interface PersistTask<A,T>
Implemented by users. Tasks should be stateless.
-
Method Summary
Modifier and TypeMethodDescriptiondefault PersistTask<A, Void> andThenDo(PersistTask<A, ?> next) Executes this task and then the given one, discarding any results.default <B> PersistTask<A, B> compose(PersistTask<T, B> task) Creates a task that is the composition of this andtask.default <B> PersistTaskIterable<A, B> compose2(PersistTask<T, Iterable<B>> task) Executes the given a task that returns a list with the result of this task.default PersistTask<A, T> composeWhen(PersistTask<T, Boolean> predicate, PersistTask<T, T> other) Run the 'other' task if the result of this task fulfills the 'predicate'.default PersistTask<A, Void> Return a new task that runs this task and discards the result.default PersistTaskIterable<Iterable<A>, T> expand()Wraps this task in a task that accepts a list of arguments applying those in order to this task and returns the collected results in a list.default PersistTaskIterable<Iterable<A>, T> expand(CollectMode collectMode) Wraps this task in a task that accepts a list of arguments applying those in order to this task and returns the collected results in a list.default @Nullable Stringdefault <V> PersistTask<A, V> ifElse(PersistTask<T, Boolean> predicate, PersistTask<T, V> ifBranch, PersistTask<T, V> elseBranch) representation of a basic if-else construct as a task executes theifBranchif the predicate is true, otherwise executes theelseBranchdefault PersistTask<A, T> orWhen(PersistTask<T, Boolean> predicate, PersistTask<A, T> other) Run the `other` task if the result of this task fulfills the `predicate`.default PersistTask<A, T> orWhenNot(PersistTask<T, Boolean> predicate, PersistTask<A, T> other) Run the `other` task if the result of this task does not fulfill the predicate.default PersistTask<A, T> passWhen(PersistTask<T, Boolean> predicate) Pass the result of this task only if it fulfills the `predicate`.default PersistTask<A, T> passWhenNot(PersistTask<T, Boolean> predicate) Pass the result of this task only if it does not fulfill the `predicate`.run(Optional<A> a, CommandContext commandContext) default PersistTask<A, T> skipErrors(org.slf4j.Logger log) Return a task that catches allExceptions when running this task to *not* propagate them.default List<PersistTask> unwrap()If this task is composed of inner tasks, you must give access to the inner tasks by overriding this method.
-
Method Details
-
run
- Throws:
Exception
-
unwrap
If this task is composed of inner tasks, you must give access to the inner tasks by overriding this method.- Returns:
- all inner tasks.
-
compose
Creates a task that is the composition of this andtask. That meanstaskis executed with the result of this as its argument. -
compose2
Executes the given a task that returns a list with the result of this task. This returns aPersistTaskIterablefor convenience. -
andThenDo
Executes this task and then the given one, discarding any results. -
discardResult
Return a new task that runs this task and discards the result. This task is executed withCollectMode.NONE. -
orWhen
Run the `other` task if the result of this task fulfills the `predicate`. The 'other' task will be executed using the initial argument. -
composeWhen
Run the 'other' task if the result of this task fulfills the 'predicate'. The 'other' task will use the result of the current task as argument. -
orWhenNot
Run the `other` task if the result of this task does not fulfill the predicate. -
passWhen
Pass the result of this task only if it fulfills the `predicate`. -
passWhenNot
Pass the result of this task only if it does not fulfill the `predicate`. -
ifElse
default <V> PersistTask<A,V> ifElse(PersistTask<T, Boolean> predicate, PersistTask<T, V> ifBranch, PersistTask<T, V> elseBranch) representation of a basic if-else construct as a task executes theifBranchif the predicate is true, otherwise executes theelseBranch- Parameters:
predicate- the predicate taskifBranch- the if taskelseBranch- the else task
-
expand
Wraps this task in a task that accepts a list of arguments applying those in order to this task and returns the collected results in a list. How the results are collected is defined byCollectMode. -
expand
Wraps this task in a task that accepts a list of arguments applying those in order to this task and returns the collected results in a list. The results are collected according to the value ofCollectModewhich is obtained from the currentmodevia keyKeys.COLLECTMODE. If no such key is present, it defaults toCollectMode.ALL. -
skipErrors
Return a task that catches allExceptions when running this task to *not* propagate them. They are logged only. This can be useful when doing batch processing to skip erroneous input (and not let the whole task fail).- Parameters:
log- the logger used to log the exception (level ERROR)
-
getDescription
- Returns:
- an optional plain-text description of this task
-