In this article
A scheduling script can use any number of rules. A scheduling rule consists of sub-rules and actions.
A rule can be seen as a container for sub-rules. To correctly define a rule it should contain at least one sub-rule, for example specifying what extended status during which shift will trigger the script, and one action for this sub-rule, for example specifying the action that is to be performed and how it is to be executed when the sub-rule is satisfied. A rule can contain any number of sub-rules, and a sub-rule can contain any number of actions.
You can search through an existing scheduling script for a particular rule, sub-rule or action (go to Searching for a Particular Rule, Sub-rule or Action in the Scheduling Rules List for more information).
Specifying a Scheduling Script Rule
- Open the scheduling script in the View mode (go to Viewing the Existing Scheduling Script Settings for more information).
Figure 1 - Viewing the scheduling rule list for the selected scheduling script
- Scheduling rules are presented in the list as a hierarchy where sub-rules are presented as branches of the appropriate rules, and actions are presented as branches of the appropriate sub-rules.
- The sub-rules and actions will normally be executed in the order they are listed.
- By default all listed items are collapsed. You can expand any item by clicking the plus sign in front of its name or you can expand or collapse all items simultaneously by pressing the Expand All
or Collapse All
buttons on the toolbar.
From this tab you can create new, edit and delete existing rules, sub-rules and actions. All these operations can be performed by using the buttons in the toolbar above the list, or by selecting commands in the menu that appears when you right-click any listed item.
You can copy and then paste selected rules, sub-rules and actions. Copied items can only be pasted into the same scheduling script. All items are copied alone, without sub-items (that is rules are copied without sub-rules, sub-rules without actions).
You can move sub-rules up or down the list within the limits of one rule, and you can move actions up or down the list within the limits of one sub-rule.
Operations are applied only to the item currently selected in the list, or to the item that you right-click upon.
- To create a new rule, select a rule in the list and click the New button
on toolbar, or right-click the selected rule and choose New from the context menu. The new rule is inserted in the list below the selected one.
- To create a new sub-rule, select a sub-rule in the list and click the New button
on toolbar, or right-click the required rule and choose New Subrule from the context menu.
- To create a new action, select an action in the list and click the New button
on toolbar, or right-click the required sub-rule and choose New Action from the context menu.
You can also export the defined scheduling rule description (along with all sub-rules and actions specified for this rule).
New Rule
The New command for a rule displays the dialog as shown below.
Figure 2 - Adding a new scheduling rule
- Enter the rule description in the Description field.
- Click Add to create the rule.
The list in the frame refreshes, and the new rule appears in this list. The rule number (displayed in the first grid column) is a unique number generated by the system and cannot be edited. Normally it shows the execution order of the rule.
New Sub-Rule
The New command for a sub-rule displays the dialog as shown below.
Figure 3 - Adding a new sub-rule
- Enter a filter expression in the Filter field (in case you need to apply this sub-rule only to interviews matching this filter).
- Check the Filter enabled box to enable the filter, otherwise leave it clear.
- Select the required interview extended status (this sub-rule will trigger the script when an interview is assigned this state).
- Select the required shift type (this sub-rule will trigger the script only during this shift).
- Enter a description for the sub-rule.
- Click Add to create the sub-rule.
The list in the frame refreshes, and the new sub-rule appears in this list as a branch of the selected rule.
The sub-rule ID (displayed in the first grid column) is a unique number generated by the system and cannot be edited. Normally it shows the execution order of the sub-rule.
New Action
The New command for an action displays the dialog as shown below.
Figure 4 - Adding a new action
The Action enabled box is checked by default. Clear it to disable this action.
- Enter the filter expression in the SubFilter field (this expression is added to the sub-rule filter expression, and the action subfilter is applied after the sub-rule filter). Refer to the Forsta Scripting documentation for instructions on how you can use different functions to build a subfilter expression.
- Check the Filter enabled box to enable the subfilter. Otherwise leave it clear.
- Select the action type in the Action drop-down box (this specifies what action is performed). The Value field becomes accessible and allows you to enter a parameter value in the event this is required by the selected action type.
- Click Add to create the action.
A prompt appearing between these fields is context sensitive and indicates the meaning of the parameter, the required format and the correct parameter limits.
You can also choose the parameter value from the list of parameters that were already defined for use with this scheduling script on the Parameters tab (go to Creating Parameters for more information). To choose an existing parameter, and to create a "parameterized" scheduling script, select a parameter from the Parameter drop-down list.
Note that adding the "Disable call" and "Enable call" actions to a scheduling rule is the only way to automate the disabling and enabling of calls. Normally these actions can only be performed manually when these properties are explicitly set in the appropriate dialogs.
The list in the frame refreshes and the new action appears in this list as a branch of the selected sub-rule.