You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Introduction

The task scheduler provides the capability to run tasks at scheduled times, optionally repeating them as required.

It has the following capabililties:

  • Run a telephony task on a specified date and time by making an outbound call to a destination and starting the application configured on a service number
  • Run a workflow task on a specified date and time by starting a background daemon process and running a workflow (GUI) application
  • Reschedule the task on completion for a time in the future
  • Retry the task if it fails to start or fails to complete
  • Start an error task (as a background process) if the task exceeds the maximum number of tries before it completes

Scheduling can be based on the following:

  • The date and time on which tasks should be run
  • Within specified opening times
  • Not on specified holidays

Tasks can be rescheduled (i.e. run repeatedly). Various options are available for this purpose.

Tasks can be passed parameters in JSON form. This enables several tasks to use the same service number configuration.

Rescheduling a task (if the task is configured as a repeating task) involves using the IVR / Workflow object Task Reschedule.

Configuration

The task scheduler can be configured via the menu item Routing ... Task Scheduler.

The following fields can be configured in a task:

FieldSpecific to Task TypeDescription
Name
The name of the task to be scheduled
Active

When set to checked (on), then the task is active. Only active tasks will be scheduled for running.

Type

The following types are supported:

  • Telephony Application. This type dials a telephone number and runs an application associated with a service number when the destination is reached.
  • Workflow Application. This type starts a background application running (i.e. a non voice application).
DestinationTelephony ApplicationThis value is provided in the variable $caller, and is used as the number to dial for telephony processes. 
Service NumberTelephony ApplicationThe service number to use when making the outbound call for telephony processes. 
Next Scheduled
The date and time on which the task will be next scheduled. This is also used as the base for calculating the task reschedule date and time when it has run and the reschedule object in the IVR or workflow is used.
Opening Times
If configured, the task will only be run during the setup opening times. This can be used, for example, to prevent a recurring task running at night.
Holiday List
If configured, the task will only be run when it is not a holiday as specified in the holiday list. This can be used, for example, to prevent a recurring task running on holidays.
Maximum Tries
When the task is run and it does not pass through a Task Reschedule object in the workflow or IVR application, it will be tried again after one minute has expired. If the maximum number of tries is then reached, the error 

Task Control

The task scheduler uses the following fields to control how tasks are scheduled:

Field

Values

Comments

dtNextSchedule

TIMESTAMP

When the task should next be scheduled for.

Is updated when the task is rescheduled after running or repeating the max times.

nState

INTEGER

0 = READY to run (see dtNextSchedule for when)

10 = STARTING PROCESS (is in daemon being started)

20 = RUNNING (process is actually running)

-1 = RESCHEDULE (needs checking whether a reschedule is required)

-99 = DONE (job is finished and will not be rescheduled)

nCurrentTries

INTEGER

The current number of tries of starting the job.

dtStateChange

TIMESTAMP

Set when the state was changed, which enables recovery of abandoned / lost jobs.

Jobs which remain in a state for more than 5 minutes will be recovered as follows:

  • If the job is set to be rescheduled, then it will be rescheduled to the next time

  • If the job is not set to be rescheduled, then it will be moved to the error state

nRepeatingTaskInterval

INTEGER

Number of minutes to wait to reschedule the task again (repeating task).

State Diagram

Tasks are processed according to the following state diagram:

  • No labels