Package de.xima.fc.workflow.setup
Class TimePointTriggerSetup
- java.lang.Object
-
- de.xima.fc.workflow.setup.TimePointTriggerSetup
-
public final class TimePointTriggerSetup extends Object
Utility methods forEWorkflowTriggerType.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 Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOGprotected Stringtype
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddProtocolEntry(IEntityContext ec, Vorgang formRecord, EProtocolEntryProcessType type, String name, String comment)protected voidaddProtocolEntryForDeletedJob(IEntityContext ec, Locale locale, Vorgang formRecord, org.quartz.JobDetail jobDetail)protected voidaddProtocolEntryForNewJob(IEntityContext ec, Locale locale, Vorgang formRecord, WorkflowTrigger trigger, IJobWrapper job, org.quartz.Trigger quartzTrigger, Instant triggerFireInstant)protected voidaddProtocolEntryForUpdatedJob(IEntityContext ec, Locale locale, Vorgang formRecord, WorkflowTrigger trigger, IJobWrapper job, org.quartz.Trigger quartzTrigger, Instant triggerFireInstant)protected booleanallowsState(List<UuidEntityRef> states, UUID currentStateUuid)protected de.xima.cmn.criteria.FilterCriterioncontainsState(String stateKey, 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).protected de.xima.cmn.criteria.FilterCriterioncreateStateFilter(List<UuidEntityRef> states)protected de.xima.cmn.criteria.FilterCriterionfindApplicableFormRecords(IEntityContext ec, WorkflowTrigger trigger, FcTimePointProps props)protected List<WorkflowTrigger>findApplicableTriggers(IEntityContext ec, Vorgang formRecord)protected StringfindProcessDbId(org.quartz.JobDetail jobDetails)protected StringfindProcessId(org.quartz.JobDetail jobDetails)Deprecated.protected StringformatInstant(Locale locale, Instant instant)protected StringformatNextFireTime(Locale locale, org.quartz.Trigger quartzTrigger)static TimePointTriggerSetupgetInstance()protected InstantgetPreviousFireInstant(org.quartz.JobDetail job, org.quartz.Trigger trigger)protected InstantgetTriggerFireInstant(IEntityContext ec, Vorgang formRecord, FcTimePointProps props)List<ApplyToExistingFormRecordResult>handleApplyToExistingFormRecords(IEntityContext ec, WorkflowTrigger trigger, ITriggerHandler<TData> handler)<C extends de.xima.cmn.criteria.interfaces.IFilterableCriteriaManager & de.xima.cmn.criteria.interfaces.IQueryHintProviding>
voidhandlePostBulkDeleteFormRecord(IEntityContext ec, C cm, ITriggerHandler<TData> handler)Create, updates, or deletes the quartz job(s) for the trigger when aVorgangwas deleted.voidhandlePostCreateFormRecord(IEntityContext ec, Vorgang formRecord, ITriggerHandler<TData> handler)Create, updates, or deletes the quartz job(s) for the trigger when aVorgangwas created.voidhandlePostDeleteClient(IEntityContext ec, Mandant client, ITriggerHandler<TData> handler)Deletes the quartz job(s) for the trigger when aMandantwas deleted.voidhandlePostDeleteFormRecord(IEntityContext ec, Vorgang formRecord, ITriggerHandler<TData> handler)Create, updates, or deletes the quartz job(s) for the trigger when aVorgangwas deleted.voidhandlePostDeleteProject(IEntityContext ec, Projekt project, ITriggerHandler<TData> handler)Deletes the quartz job(s) for the trigger when aProjektwas deleted.voidhandlePostDeleteTrigger(IEntityContext ec, WorkflowTrigger trigger, ITriggerHandler<TData> handler)Create, updates, or deletes the quartz job(s) for the trigger when aWorkflowTriggerwas deleted.voidhandlePostUpdateFormRecord(IEntityContext ec, Vorgang formRecord, ITriggerHandler<TData> handler)Create, updates, or deletes the quartz job(s) for the trigger when aVorgangwas updated.protected booleanisAppliesToFormRecordUpdate(IEntityContext ec, Vorgang formRecord, ITriggerHandler<FcTimePointProps> handler)protected booleanisNeedToRescheduleJob(de.xima.fc.workflow.setup.CheckRescheduleParams<FcTimePointProps> params)protected booleanisRemoveJobWhenStateIsDeleted(WorkflowState state, org.quartz.JobDetail jobDetail)protected IJobWrappernewJob(IEntityContext ec, Vorgang formRecord, WorkflowTrigger trigger, FcTimePointProps props, Instant triggerFireInstant)
-
-
-
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)
-
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 IDof 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 IDof 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:
trueif the states contain the current state or when the states are empty,falseotherwise.
-
containsState
protected final de.xima.cmn.criteria.FilterCriterion containsState(String stateKey, 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:
stateKey- Key of the search termstateUuid- 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<TData> 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<TData> handler)
Create, updates, or deletes the quartz job(s) for the trigger when aVorgangwas 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 aVorgangwas 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 aVorgangwas 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 aWorkflowTriggerwas 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 aProjektwas 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 aMandantwas 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 aVorgangwas 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)
-
-