Class 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 Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • type

        protected final String type
    • Method Detail

      • addProtocolEntryForDeletedJob

        protected void addProtocolEntryForDeletedJob​(IEntityContext ec,
                                                     Locale locale,
                                                     Vorgang formRecord,
                                                     org.quartz.JobDetail jobDetail)
      • 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)
      • 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.
      • 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)
      • handlePostBulkDeleteFormRecord

        public final <C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding> void handlePostBulkDeleteFormRecord​(IEntityContext ec,
                                                                                                                                                                                      C cm,
                                                                                                                                                                                      ITriggerHandler<TData> 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<TData> 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<TData> 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<TData> 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<TData> 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<TData> 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<TData> 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.
      • formatNextFireTime

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