Action Execution

The rules engine can execute actions immediately when a record is saved, or it can defer the action until a later time.

All actions that modify an object (answer, contact, incident, chat, opportunity, organization, target, or task) are executed immediately upon saving the record. For example, an action can change the status of an incident, set an answer access level, or set a custom field. These actions are executed before the next condition is evaluated. Actions that transition to another state or function or those that stop processing are also executed immediately.

All other actions are passed to the API as deferred actions. Some of these delayed actions are executed immediately after the rules engine finishes processing, while others are flagged to be handled later. Examples of actions that are executed immediately after rules processing include applying SLA instances and sending email. Events such as escalation are scheduled to be handled later.

You must select an object event handler from the Execute Object Event Handler drop-down list to trigger a custom process. For objects to display in the Execute Object Event Handler drop-down menu, they must be added on the process designer and then the process model must be deployed. See Add an Object Event Handler and Overview of Custom Processes.

When business rules are triggered (by adding or updating an object), the rules engine processes every rule in the initial state, and continues processing until it reaches the last rule, regardless of how many rules have already been matched. Unless otherwise directed, the rules engine processes only the rules in the initial state. To process rules in other states or functions, you must set an action for one or more rules in the initial state to transition to another state or function.

These actions are available for all rule bases (assuming that additional states and functions exist to be transitioned to):

  • Stop Processing Rules—Stops processing, regardless of how many rules remain in the state. Use this action when you do not want the object compared to any more rules in this or any other state. When you select the Stop Processing Rules action, the rules engine stops evaluating the object against the rules base. However, the action does not prevent future processing of the object. When the object is updated, the rules engine will process it again. If you want to prevent the object from being processed in future updates, create a state that has no rules and transition the object into it.
  • Call Function—Transitions to the function you specify and processes the rules in the function. After the actions in the function rules are executed, control returns to the next action in the rule that called the function. If you call a function that contains a rule with either an action to stop processing or to transition to another state, the rules engine never returns to the rule that called the function.

    For example, assume the calling rule contains two actions in this order:

    1. Call a function containing a rule with a stop-processing action.
    2. Assign the incident to a specific queue.

    In this example, the queue assignment is never made because the prior action stopped processing.

  • Transition State and Stop—Transitions to the state you specify and stops processing. Use this action when you want the object moved from one state to another, such as from the Created state to the Updated state, but you do not want processing to continue. In effect, you are setting up the object for the next edit so rules processing starts at the appropriate state. For example, depending on your business process, you may want to set up a separate state for incidents that have been updated so they do not continue to be compared to rules in the initial state.
  • Transition State and Continue—Transitions to the state you specify and continues processing all the rules in that state until all of those rules process (unless you add another action to stop processing, transition to another state, or call a function). Use this action when you want the object to continue to be compared to the rules in the state you transition to.

You can add certain actions without selecting a value. With this functionality, the rule actions are consistent with values that can be set to No Value in records. For example, you can save an incident without assigning it to a staff member (by selecting the No Value option). Actions that can be added without selecting a value (that is, the value is set to No Value) include:

  • Set Product
  • Set Category
  • Set Disposition
  • Set Mailbox
  • Set Assigned
  • Set Queue
Note: You must assign a value to any required field. For example, if products and categories are required, you cannot select a No Value option to the Set Product action in a rule.