Interface PersistTask<A,T>

All Known Subinterfaces:
AggregateTasks.AggregateTask<N>, CalendarEventLabelTask, CascadingDeleteService, CreateAnswerTask, CreateOrderGeneratorBeanTask, 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, CreateMovementTask, CreateMultipleChoiceAnswerTask, CreateOrderPositionsTask, CreateOrderRateTask, CreateOrdersTask, CreateOrderTask, CreateOutputJobItemPersistTask, CreateOutputJobPersistTask, CreatePrepaymentTask, CreatePreviewTask, CreatePrincipalTask, CreateReservationBodyTask, CreateResourcePersistTask, CreateSingleChoiceAnswerTask, CreateTeamMemberTask, CreateTextAnswerTask, CreateTimereportRecordTask, CreateTrainerBodyTask, CreateVoucherForIncomingPaymentTask, CreateVouchersTask, CreateWageTask, CreateWidgetConfigTask, CreateWidgetRecordTask, DebitorDunningCompensationTask, DebitorTotalsTask, DefaultCreateOrderGeneratorBeanTask, DefaultGetRatingTask, DeleteCaseDocuments, DeleteRelationsTask, DeleteSectionTask, DeleteTask, DuplicateContentTask, DuplicatePageContentTask, DuplicateResourceContentTask, DuplicateSectionTask, 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, PersistTaskBase, PileImportTask, 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, 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 Details

    • run

      @Nullable T run(Optional<A> a, CommandContext commandContext) throws Exception
      Throws:
      Exception
    • unwrap

      default List<PersistTask> 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

      default <B> PersistTask<A,B> compose(PersistTask<T,B> task)
      Creates a task that is the composition of this and task. That means task is executed with the result of this as its argument.
    • compose2

      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. This returns a PersistTaskIterable for convenience.
    • andThenDo

      default PersistTask<A,Void> andThenDo(PersistTask<A,?> next)
      Executes this task and then the given one, discarding any results.
    • discardResult

      default PersistTask<A,Void> discardResult()
      Return a new task that runs this task and discards the result. This task is executed with CollectMode.NONE.
    • orWhen

      default 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`. The 'other' task will be executed using the initial argument.
    • composeWhen

      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'. The 'other' task will use the result of the current task as argument.
    • orWhenNot

      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.
    • passWhen

      default PersistTask<A,T> passWhen(PersistTask<T,Boolean> predicate)
      Pass the result of this task only if it fulfills the `predicate`.
    • passWhenNot

      default PersistTask<A,T> passWhenNot(PersistTask<T,Boolean> predicate)
      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 the ifBranch if the predicate is true, otherwise executes the elseBranch
      Parameters:
      predicate - the predicate task
      ifBranch - the if task
      elseBranch - the else task
    • expand

      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. How the results are collected is defined by CollectMode.
    • expand

      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. The results are collected according to the value of CollectMode which is obtained from the current mode via key Keys.COLLECTMODE. If no such key is present, it defaults to CollectMode.ALL.
    • skipErrors

      default PersistTask<A,T> skipErrors(org.slf4j.Logger log)
      Return a task that catches all Exceptions 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

      @Nullable default @Nullable String getDescription()
      Returns:
      an optional plain-text description of this task