Class WorkflowScheduler

java.lang.Object
com.axelor.workflow.schedule.WorkflowScheduler

@Singleton public class WorkflowScheduler extends Object
The engine's cluster-safe scheduler and its one threading seam. Each poll, per tenant, recovers captures, delivers messages, recovers joins, and claims whatever is due (timer states, parked runs and branches, approval deadlines) with a conditional update one node wins. Cost follows the due rows, never a business table.
  • Constructor Details

    • WorkflowScheduler

      public WorkflowScheduler()
  • Method Details

    • setResumeExecutorForTesting

      public static void setResumeExecutorForTesting(Executor executor)
    • onStart

      public void onStart(StartupEvent event)
    • onStop

      public void onStop(ShutdownEvent event)
    • start

      public void start()
    • stop

      public void stop()
    • resumeAfterCommit

      public LocalDateTime resumeAfterCommit(String parkKey)
      Resume the park under parkKey once the current transaction commits, on a worker of its own instead of the next poll. Only a shortcut: when it never runs, the poll takes the park at the returned wake time, which stays clear of a resume already under way.
    • poll

      public void poll()
      Process one batch for the current tenant. Public for tests; the scheduler calls it per tenant.