Class TimePointTriggerSetup

java.lang.Object
de.xima.fc.workflow.setup.TimePointTriggerSetup

public final class TimePointTriggerSetup extends Object
Utility methods for EWorkflowTriggerType.FC_TIME_POINT. Sets up the quartz listeners for triggering a task at a certain point in time.
Since:
7.0.0
Author:
XIMA MEDIA GmbH
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
    • type

      protected final String type
  • Method Details

    • addProtocolEntryForDeletedJob

      protected void addProtocolEntryForDeletedJob(IEntityContext ec, Locale locale, Vorgang formRecord, org.quartz.JobDetail jobDetail)
    • addProtocolEntryForNewJob

      protected void addProtocolEntryForNewJob(IEntityContext ec, Locale locale, Vorgang formRecord, WorkflowTrigger trigger, IJobWrapper job, org.quartz.Trigger quartzTrigger, Instant triggerFireInstant)
    • addProtocolEntryForUpdatedJob

      protected void addProtocolEntryForUpdatedJob(IEntityContext ec, Locale locale, Vorgang formRecord, WorkflowTrigger trigger, IJobWrapper job, org.quartz.Trigger quartzTrigger, Instant triggerFireInstant)
    • findApplicableFormRecords

      protected de.xima.cmn.criteria.FilterCriterion findApplicableFormRecords(IEntityContext ec, WorkflowTrigger trigger, FcTimePointProps props)
    • findApplicableTriggers

      protected List<WorkflowTrigger> findApplicableTriggers(IEntityContext ec, Vorgang formRecord)
    • findProcessId

      @Deprecated protected String findProcessId(org.quartz.JobDetail jobDetails)
      Deprecated.
      Parameters:
      jobDetails - Custom parameters of the job.
      Returns:
      The process ID of the form record to which the job applies.
    • findProcessDbId

      protected String findProcessDbId(org.quartz.JobDetail jobDetails)
      Parameters:
      jobDetails - Custom parameters of the job.
      Returns:
      The database ID of the form record to which the job applies.
    • getPreviousFireInstant

      protected Instant getPreviousFireInstant(org.quartz.JobDetail job, org.quartz.Trigger trigger)
    • getTriggerFireInstant

      protected Instant getTriggerFireInstant(IEntityContext ec, Vorgang formRecord, FcTimePointProps props)
    • isAppliesToFormRecordUpdate

      protected boolean isAppliesToFormRecordUpdate(IEntityContext ec, Vorgang formRecord, ITriggerHandler<FcTimePointProps> handler)
    • isNeedToRescheduleJob

      protected boolean isNeedToRescheduleJob(de.xima.fc.workflow.setup.CheckRescheduleParams<FcTimePointProps> params)
    • isRemoveJobWhenStateIsDeleted

      protected boolean isRemoveJobWhenStateIsDeleted(WorkflowState state, org.quartz.JobDetail jobDetail)
      Parameters:
      state - State to check.
      jobDetail - Job to check.
      Returns:
      Whether it was scheduled for that state and should be removed when the state is removed.
    • newJob

      protected IJobWrapper newJob(IEntityContext ec, Vorgang formRecord, WorkflowTrigger trigger, FcTimePointProps props, Instant triggerFireInstant)
    • getInstance

      public static TimePointTriggerSetup getInstance()
      Returns:
      The singleton instance of this setup utility.
    • allowsState

      protected final boolean allowsState(List<UuidEntityRef> states, UUID currentStateUuid)
      Parameters:
      states - States that are allowed.
      currentStateUuid - UUID of the form's current state.
      Returns:
      true if the states contain the current state or when the states are empty, false otherwise.
    • containsState

      protected final de.xima.cmn.criteria.FilterCriterion containsState(String statesKey, UUID stateUuid)
      Creates a filter that matches when at least one state search term has a value set to the given state, or when no state search terms exist at all (= no restriction when no state was set).
      Parameters:
      statesKey - Key of the search term
      stateUuid - UUID of the state to match.
      Returns:
      A new filter criterion for matching the given state.
    • createStateFilter

      protected final de.xima.cmn.criteria.FilterCriterion createStateFilter(List<UuidEntityRef> states)
    • handleApplyToExistingFormRecords

      public final List<ApplyToExistingFormRecordResult> handleApplyToExistingFormRecords(IEntityContext ec, WorkflowTrigger trigger, ITriggerHandler<FcTimePointProps> handler)
    • handlePostBulkDeleteFormRecord

      public final <C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> void handlePostBulkDeleteFormRecord(IEntityContext ec, C cm, ITriggerHandler<FcTimePointProps> handler)
      Create, updates, or deletes the quartz job(s) for the trigger when a Vorgang was deleted.
      Parameters:
      ec - Current entity context for accessing the database.
      cm - Criteria manager for the deleted records.
      handler - Handler for the state timer trigger.
    • handlePostCreateFormRecord

      public final void handlePostCreateFormRecord(IEntityContext ec, Vorgang formRecord, ITriggerHandler<FcTimePointProps> handler)
      Create, updates, or deletes the quartz job(s) for the trigger when a Vorgang was created.
      Parameters:
      ec - Current entity context for accessing the database.
      formRecord - Form record that was created.
      handler - Handler for the state timer trigger.
    • handlePostDeleteFormRecord

      public final void handlePostDeleteFormRecord(IEntityContext ec, Vorgang formRecord, ITriggerHandler<FcTimePointProps> handler)
      Create, updates, or deletes the quartz job(s) for the trigger when a Vorgang was deleted.
      Parameters:
      ec - Current entity context for accessing the database.
      formRecord - Form record that was deleted.
      handler - Handler for the state timer trigger.
    • handlePostDeleteTrigger

      public final void handlePostDeleteTrigger(IEntityContext ec, WorkflowTrigger trigger, ITriggerHandler<FcTimePointProps> handler)
      Create, updates, or deletes the quartz job(s) for the trigger when a WorkflowTrigger was deleted.
      Parameters:
      handler - Handler for the state timer trigger.
      trigger - Trigger that was deleted.
      ec - Current entity context for accessing the database.
    • handlePostDeleteProject

      public final void handlePostDeleteProject(IEntityContext ec, Projekt project, ITriggerHandler<FcTimePointProps> handler)
      Deletes the quartz job(s) for the trigger when a Projekt was deleted.
      Parameters:
      handler - Handler for the state timer trigger.
      project - Project that was deleted.
      ec - Current entity context for accessing the database.
    • handlePostDeleteClient

      public final void handlePostDeleteClient(IEntityContext ec, Mandant client, ITriggerHandler<FcTimePointProps> handler)
      Deletes the quartz job(s) for the trigger when a Mandant was deleted.
      Parameters:
      handler - Handler for the state timer trigger.
      client - Client that was deleted.
      ec - Current entity context for accessing the database.
    • handlePostUpdateFormRecord

      public final void handlePostUpdateFormRecord(IEntityContext ec, Vorgang formRecord, ITriggerHandler<FcTimePointProps> handler)
      Create, updates, or deletes the quartz job(s) for the trigger when a Vorgang was updated.
      Parameters:
      ec - Current entity context for accessing the database.
      formRecord - Form record that was updated.
      handler - Handler for the state timer trigger.
    • addProtocolEntry

      protected final void addProtocolEntry(IEntityContext ec, Vorgang formRecord, EProtocolEntryProcessType type, String name, String comment)
    • formatInstant

      protected final String formatInstant(Locale locale, Instant instant)
    • formatNextFireTime

      protected final String formatNextFireTime(Locale locale, org.quartz.Trigger quartzTrigger)