Elements of Rules and Rule Bases

Before you create a rule base, you should be familiar with the elements of rules, rule bases, and how these elements relate to each other.

When you open the Rules editor, the left side of the content pane displays the rules in each of the rule base states and functions. It also lists rule base variables. The right side of the content pane is the editor, which lets you add and edit states, functions, and variables for a rule base. This is also where you add and edit conditions and actions for individual rules.

States and functions—States and functions provide a way for you to organize business rules and define the sequence for processing rules. Each rule base must have at least one state—the initial state—before rules processing can begin.

Variables—A variable is a piece of data with a value that can change during rules processing. You define what its default, or starting, value should be. Then, based on conditions you specify, rule actions can modify the variable. You can also use the value of a variable as a condition of a rule. The value of the variable is temporary, existing only during the particular rules processing session. The next time rules processing starts, the variable value resets to the default value.

Conditions—A rule is basically an “if-then” statement. If something meets this condition, then take this action. The “if” statement is the rule condition. An example of a condition statement is “If the contact’s state equals Montana.” Each rule base has a unique set of conditions that the rules engine can use to evaluate the object.
Note: Keep in mind that having multiple conditions in a rule is more common than having only one. For the sake of simplified discussion, assume that any singular “condition” referenced in this section may actually be a set of conditions.

Logical expressions—When you add two or more conditions, rules processing uses a logical expression to define the relationship of the conditions. Logical expressions join conditions using an AND (&) or an OR (|) relationship between them. For example, you might want to look for customers who have purchased Product A and who have also purchased a one-year warranty. Or you might want to find customers who have purchased Product A or Product B. The default logical expression joins all conditions with AND. If you want all conditions to apply, it isn’t necessary to edit the logical expressions.

Actions—Actions include the “then” part of an “if-then” rule or the “then” and “else” parts of an “if-then-else” rule. If the conditions you specified in a rule are met, then the rules engine implements the rule actions. The list of available actions depends on the rule object type. An action can be as simple as stopping the rules processing. Or it can be a more complex action. It can assign an incident to an agent, send that agent a notification, and define an escalation process if the incident isn’t resolved within a certain time frame.