Package de.xima.fc.timing.worker
Class TimePointWorker
java.lang.Object
de.xima.fc.timing.worker.TimePointWorker
- All Implemented Interfaces:
org.quartz.Job
Worker for invoking a trigger of the new workflow for the
EWorkflowTriggerType.FC_TIME_POINT trigger.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringKey for the UUID of the state for which the job was scheduled most recently.protected static final StringThe last trigger fire time, as anInstant.getEpochSecond()protected static final Stringprotected static final StringDeprecated.protected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionA new instance of the state timer job for invoking a trigger of typeEWorkflowTriggerType.FC_TIME_POINT. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddCommonEntries(org.quartz.JobDataMap dataMap, Vorgang formRecord, WorkflowTrigger trigger, Instant triggerFireInstant) protected booleancheckPreconditions(org.quartz.JobExecutionContext ctx, WorkflowTriggerWorkerParams<FcTimePointProps> params) Optional check for the preconditions before the trigger is invoked.static org.quartz.JobDataMapcreateJobMap(Vorgang formRecord, WorkflowTrigger trigger, FcTimePointProps props, Instant triggerFireInstant) Creates the job data map for the quartz job required by a workflow trigger of typeEWorkflowTriggerType.FC_TIME_POINT.final voidexecute(org.quartz.JobExecutionContext ctx) protected voidinvokeTrigger(org.quartz.JobExecutionContext ctx, WorkflowTriggerWorkerParams<FcTimePointProps> params) protected booleanisDeleteJobAfterwards(org.quartz.JobExecutionContext ctx) static UUIDreadLastScheduledStateUuid(org.quartz.JobDataMap jobDataMap) Reads the UUID of theWorkflowStatefor which the job was scheduled most recently from the job map created by this worker.static InstantreadPreviousFireTime(org.quartz.JobDataMap jobDataMap) Reads the last fire time from the job map created by this worker.static StringreadProcessDbId(org.quartz.JobDataMap jobDataMap) Reads theprocess database IDfrom the job map created by this worker.static StringreadProcessId(org.quartz.JobDataMap jobDataMap) Deprecated.static longreadRetryCount(org.quartz.JobDataMap jobDataMap) Reads theprocess IDfrom the job map created by this worker.static StringreadTriggerName(org.quartz.JobDataMap jobDataMap) Reads the name of theWorkflowStates from the job map created by this worker.static StringreadUniqueId(org.quartz.JobDataMap jobDataMap) Reads the unique ID from the job map created by this worker that indicates the identity of the job.
-
Field Details
-
KEY_LAST_SCHEDULED_STATE_UUID
Key for the UUID of the state for which the job was scheduled most recently.- See Also:
-
KEY_PREVIOUS_FIRE_TIME
The last trigger fire time, as anInstant.getEpochSecond()- See Also:
-
KEY_PROCESS_DB_ID
- See Also:
-
KEY_PROCESS_ID
Deprecated.UseKEY_PROCESS_DB_ID. The process ID may change.Theprocess IDof the form record.- See Also:
-
KEY_RETRY_COUNT
- See Also:
-
KEY_TRIGGER_ID
- See Also:
-
KEY_TRIGGER_NAME
- See Also:
-
KEY_UNIQUE_ID
- See Also:
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
TimePointWorker
public TimePointWorker()A new instance of the state timer job for invoking a trigger of typeEWorkflowTriggerType.FC_TIME_POINT.
-
-
Method Details
-
isDeleteJobAfterwards
protected boolean isDeleteJobAfterwards(org.quartz.JobExecutionContext ctx) -
createJobMap
public static org.quartz.JobDataMap createJobMap(Vorgang formRecord, WorkflowTrigger trigger, FcTimePointProps props, Instant triggerFireInstant) Creates the job data map for the quartz job required by a workflow trigger of typeEWorkflowTriggerType.FC_TIME_POINT.- Parameters:
formRecord- Form record to which the trigger applies.trigger- The actual workflow trigger.props- Deserialized properties model of the trigger.triggerFireInstant- Instant for when the trigger was originally scheduled. May be different from the fire time of the quartz trigger.- Returns:
- The job data map with the details for the worker.
-
readLastScheduledStateUuid
Reads the UUID of theWorkflowStatefor which the job was scheduled most recently from the job map created by this worker.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The UUIDs of the
WorkflowStates contained in the given job map.
-
execute
public final void execute(org.quartz.JobExecutionContext ctx) throws org.quartz.JobExecutionException - Specified by:
executein interfaceorg.quartz.Job- Throws:
org.quartz.JobExecutionException
-
checkPreconditions
protected boolean checkPreconditions(org.quartz.JobExecutionContext ctx, WorkflowTriggerWorkerParams<FcTimePointProps> params) Optional check for the preconditions before the trigger is invoked. Optional because the workflow event runner checks the preconditions as well.- Parameters:
ctx- Current job execution context.params- Parameters for the trigger.- Returns:
trueto proceed with firing the trigger,falseotherwise.
-
invokeTrigger
protected void invokeTrigger(org.quartz.JobExecutionContext ctx, WorkflowTriggerWorkerParams<FcTimePointProps> params) throws CouldNotLockFormRecordException - Throws:
CouldNotLockFormRecordException
-
readPreviousFireTime
Reads the last fire time from the job map created by this worker.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The previous fire time that was stored when the trigger was created / updated.
-
readProcessDbId
Reads theprocess database IDfrom the job map created by this worker.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The process ID stored in the given job map.
-
readProcessId
Deprecated.UsereadProcessDbId(JobDataMap). The process ID may change.Reads theprocess IDfrom the job map created by this worker.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The process ID stored in the given job map.
-
readRetryCount
public static long readRetryCount(org.quartz.JobDataMap jobDataMap) Reads theprocess IDfrom the job map created by this worker.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The process ID stored in the given job map.
-
readTriggerName
Reads the name of theWorkflowStates from the job map created by this worker.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The name of the
WorkflowTriggers contained in the given job map.
-
readUniqueId
Reads the unique ID from the job map created by this worker that indicates the identity of the job. This ID is changed each time the JOB is created or updated.- Parameters:
jobDataMap- The job map created by worker.- Returns:
- The process ID stored in the given job map.
-
addCommonEntries
protected static void addCommonEntries(org.quartz.JobDataMap dataMap, Vorgang formRecord, WorkflowTrigger trigger, Instant triggerFireInstant)
-
KEY_PROCESS_DB_ID.