Class StateTimerWorker

  • All Implemented Interfaces:
    org.quartz.Job

    public class StateTimerWorker
    extends Object
    Worker for invoking a trigger of the new workflow for the EWorkflowTriggerType.FC_STATE_TIMER trigger.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • isDeleteJobAfterwards

        protected boolean isDeleteJobAfterwards​(org.quartz.JobExecutionContext ctx)
      • createJobMap

        public static org.quartz.JobDataMap createJobMap​(Vorgang formRecord,
                                                         WorkflowTrigger trigger,
                                                         FcStateTimerProps props,
                                                         Instant triggerFireInstant)
        Creates the job data map for the quartz job required by a workflow trigger of type EWorkflowTriggerType.FC_STATE_TIMER.
        Parameters:
        formRecord - Form record to which the trigger applies.
        trigger - The actual workflow trigger.
        props - Deserialized properties model of the trigger.
        Returns:
        The job data map with the details for the worker.
      • readLastScheduledStateUuid

        public static UUID readLastScheduledStateUuid​(org.quartz.JobDataMap jobDataMap)
        Reads the UUID of the WorkflowState for 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:
        execute in interface org.quartz.Job
        Throws:
        org.quartz.JobExecutionException
      • checkPreconditions

        protected boolean checkPreconditions​(org.quartz.JobExecutionContext ctx,
                                             WorkflowTriggerWorkerParams<TData> 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:
        true to proceed with firing the trigger, false otherwise.
      • readPreviousFireTime

        public static Instant readPreviousFireTime​(org.quartz.JobDataMap jobDataMap)
        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.
      • readProcessId

        public static String readProcessId​(org.quartz.JobDataMap jobDataMap)
        Reads the process ID from 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 the process ID from 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

        public static String readTriggerName​(org.quartz.JobDataMap jobDataMap)
        Reads the name of the WorkflowStates 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.
      • addCommonEntries

        protected static void addCommonEntries​(org.quartz.JobDataMap dataMap,
                                               Vorgang formRecord,
                                               WorkflowTrigger trigger,
                                               Instant triggerFireInstant)