SmartScheduler

SmartScheduler

Sub-pages

Executive summary

The SmartScheduler is the SmartFramework's infrastructure for executing long-running, asynchronous and recurring jobs without depending on the OpenEdge AppServer. Jobs are defined as records in the SmartDB through the Scheduler Job Maintenance dialog, optionally given a recurring plan, and executed by one or more Scheduler runtime processes that poll the database for due work.

A Scheduler runtime is a finite-lifetime ABL batch process. It must therefore be hosted by an external supervisor that re-launches it whenever it terminates. Several supervisors are supported equally — Jenkins (recommended for its log access and email notifications), the Windows Task Scheduler, any Windows service wrapper that runs a batch script as a Windows service, Linux cron jobs, Linux daemon scripts (init.d / systemd units), or any other process supervisor capable of re-starting a process. Jenkins is one option among these, not a requirement. Multiple runtimes can run in parallel on one machine or across machines, partitioned by queues so they never collide on the same job.

Application code interacts with the scheduler through Consultingwerk.SmartFramework.Scheduler.ISchedulerService (resolved via Consultingwerk/get-service.i). The service exposes methods to schedule one-off runs, to send a cancel signal to a running job, to pause and resume planned jobs, and to reschedule failed runs. The work itself is packaged as a class implementing Consultingwerk.SmartFramework.Scheduler.ISchedulerJobCommand. Long-running commands cooperate with the runtime by polling SchedulerRuntime:IsCancelled() for cancellation and by calling SchedulerRuntime:UpdateJobStatus to publish status text and percentage-done values.

The sub-pages above cover each concern in depth:

  • Configuring the SmartScheduler runtime — installing, configuring and hosting one or more runtime processes (Jenkins, Windows Task Scheduler, Windows services, Linux cron, init.d/systemd, or any other process supervisor).

  • Scheduling a Job from Code — original walk-through for the simplest scheduling case.

  • Maintaining and monitoring scheduled Jobs from GUI frontend — operator's view in the Scheduler Job Maintenance, Job Plan Maintenance and Job Status Monitor screens.

  • Writing a SmartScheduler Job Command — implementing ISchedulerJobCommand, parameter-passing conventions, the cancel-polling and progress-reporting APIs on SchedulerRuntime, and the optional ICheckReadyToExecute interface.

  • Controlling Scheduled Jobs from Code — the full ISchedulerService surface: ScheduleJob overloads, SetJobStatusCancelSignal, SetJobStatusOnHold, SetJobStatusResumed, RescheduleFailedJob, and the SmartSchedulerJobStatus state machine.

  • SmartScheduler Queues — using queues to partition work across runtimes and to support different operating systems, priority lanes, resource-isolated jobs and per-tenant separation.