Scheduling and Running Tasks (2.4)
To schedule recipes and other tasks, you use the Business Scheduler, which you can also use to run tasks manually. There are three types of tasks:
Scheduling a Task
To schedule a task:
-
Click the Business Scheduler icon in the application menu.
The system displays a table that lists the currently defined schedule items; if needed, use the filters at the top of the table to narrow down what is shown.
-
Click Schedule Task.
The system displays a table that lists the items that can be scheduled. If needed, use the filters at the top of the table to narrow down what is shown.
-
Click the row corresponding to the item to schedule.
-
Specify the following information:
-
Entity—Required. Select the entity whose calendar information you want to use.
-
Enabled—Optionally clear this check box if you want to disable this task (for example, if you are not ready to run or schedule it).
-
Tag, Dependency Expression, and Dependency Inactivity—See Managing Task Dependencies.
-
Workflow Role for Handling Exceptions—Required. Select the role that should receive any workflow items in case of exceptions related to this task.
-
Email Distribution List for Error Notifications—Select the email distribution list that should receive messages when this task encounters an error.
-
Email Distribution List for Success Notifications—Select the email distribution list that should receive messages when this task runs successfully.
Then for Scheduling Details, either select the Manually Run check box or specify the following information:
-
Type of frequency to run at —Required. Select the option that best describes how often to run this task.
Depending on your selection, the page may show additional items to control the scheduling, such as the specific days of the week, the specific months, and so on.
-
On Holidays —Required. Select the option that describes how to handle holidays: Don’t Run, Run Anyway, Run Next Business Day, Run Previous Business Day.
-
Schedule Task End Time—Optionally select this if you want the task to stop running at a specific date and time. If you select this option, also specify Task End Date and Task End Time.
-
-
Click Save Task.
Managing Task Dependencies
There may be specific tasks that you want to run only after other tasks have been run, on the same day; the system provides a way to manage these dependencies. To specify that one task (task A) should not be run until another task (task B) has completed, you use the following system:
-
Decide on a unique, short tag that describes this dependency (for example, backup). Note that tags are case-sensitive.
-
When scheduling the task or tasks that need to occur first (in our example, task B), specify the Tag field, using the tag you have decided on.
-
When scheduling the dependent task (task A), specify Dependency Expression, which uses a special kind of syntax. In its simplest form, a dependency expression has the form FUNCTIONNAME(tag), where FUNCTIONNAME is either TODAY or WINDOW and tag is a tag that has been applied to some other task. The meaning of the expression depends on the function. As an example, consider the following example dependency expression:
TODAY(backup)
This expression means that the task should not be started until the completion (today) of a task that is tagged with the backup tag.
You can combine dependency expressions via the keywords AND and OR, along with parentheses. For example:
TODAY(tagA) OR (TODAY(tagB) AND TODAY(tagC))
-
In addition to specifying Dependency Expression, you can specify Dependency Inactivity in seconds.
Functions Available in Dependency Expressions
This section provides reference information on the functions that can be used in dependency expressions:
Where tag is a tag of the event to wait for.
This dependency expression means to wait until the completion (today) of a task that is tagged with tag. Unlike the WINDOW() function, TODAY() considers only events within the same day.
Where:
-
tag is a tag of the event to wait for.
-
lower is a positive number of hours. This argument specifies how old the event can be, from the moment the system began checking for it.
-
higher is a positive number of hours. This argument specifies how long to wait for the event, from the moment when the system began checking for it.
This dependency expression means the system will either run the task if the given event was completed within the last lower hours ago or will wait higher hours for that event to complete. This window of time can span days. For example, consider a task (called Sample Task) that uses this dependency expression:
WINDOW(backup,4,4)
Suppose that Sample Task starts running at 11 PM. In this case, the system first checks to see if the backup task has completed within the last four hours (that is, after 7 PM); if so, the system starts Sample Task immediately. On the other hand, if the backup task has not completed yet, the system waits, potentially until 3 AM. At any time before 3 AM, if the backup task is completed, the system starts Sample Task after the backup task is completed.
Modifying a Task Definition
To modify a task definition (for example, to change the schedule details):
-
Click the Business Scheduler icon in the application menu.
The system displays a table that lists the items that are currently scheduled. If needed, use the filters at the top of the table to narrow down what is shown.
-
Click the three dots in the row for the task. This displays a menu.
-
Click Open Task Details.
-
Click Edit Task.
-
Modify details here in the same way as when you schedule a task.
-
Click Save Task.
The system runs the task (or attempts to) within the next minute. When it does so, it updates the Run History section of this page.
Running a Task Manually
To run a task manually:
-
Click the Business Scheduler icon in the application menu.
The system displays a table that lists the items that are currently scheduled. If needed, use the filters at the top of the table to narrow down what is shown.
Tasks that can be run manually are displayed here with Next Run as Manual; these are tasks defined with the Manually Run check box selected.
-
Click the three dots in the row for the task. This displays a menu.
-
Click Open Task Details.
-
Click Manually Run Now.
-
Click Run Task to confirm.
The system runs the task (or attempts to) within the next minute. When it does so, it updates the Run History section of this page.
Aborting a Task
To stop a task that is currently running:
-
Click the Business Scheduler icon in the application menu.
-
Click the three dots in the row for the task. This displays a menu.
-
Click Open Task Details.
-
Click Abort Task.
-
Click Abort Task to confirm.
The system runs the task (or attempts to) within the next minute. When it does so, it updates the Run History section of this page.
Also see Handling Task Errors.
Deleting a Task
To delete a task definition:
-
Click the Business Scheduler icon in the application menu.
-
Click the three dots in the row for the task. This displays a menu.
-
Click Open Task Details.
-
Click Delete.
-
Click Delete to confirm.