Rules
A rule is a business decision written in plain words, such as "Check if the order total is greater than 1000 and the customer is new". Your application asks the Rule Repository for its rules and runs them against its own data, so a rule changes what your application does without anyone changing its code. This section explains how rules are kept in the repository, how you find them, and how you open one.
Every rule is written against one source object, the data it looks at, and the repository keeps it as a series of versions:
- The rule is the decision itself: its name, its description, its type, and whether other rules may use it. Its type and whether others may use it are chosen when the rule is created and never change.
- A rule version is one wording of the rule. Each time the rule's logic changes, the change is saved as a new version. A saved version never changes, so you can always see exactly what a rule said at any point.
- The live version is the one version of the rule that your application uses. A rule has at most one live version at a time. See Going Live.
- A draft is a rule or a version that is still being worked on. See Drafts.
There are two types of rules:
- An evaluation rule answers a question with yes or no (true or false). It reads "Check if ...".
- An execution rule does something. It reads "If ... then ...", optionally with "else if" and "else", and sets values or runs actions that your application offers.
The components this section uses:
- The Rules grid: the list of every rule, one row per rule.
- The Rule dialog: one rule's record, with its statistics, its internal notes and its details.
- The Rule Versions grid and the Rule Version dialog: every version of every rule. See Rule Versions.
The Rules Grid
Click the Rules tab to see every rule in the repository. Each row is one rule, and the grid shows these columns:
| Column |
What it shows |
| Name |
The rule's name. |
| Source |
The source object the rule is written against. |
| Type |
Evaluation or Execution. |
| Reusable |
Yes when other rules may use this rule in their conditions. |
| Modified By and Modified On |
Who changed the rule last, and when. |
| Versions |
How many versions the rule has. Click the number to see them in the Rule Versions grid. |
| Drafts |
How many drafts of the rule exist. |
| Tests |
How many saved tests the rule has. |
| The three unnamed count columns |
Tests that have not been run yet, live evaluations that succeeded, and live evaluations that ended with an error. Hover over a column's heading to see which is which. |
Two icons at the start of each row open related lists: View all live evaluations of this rule and View this rule's history.
The filters over the grid narrow the list by rule, source, rule type, creator, modifier, and the dates the rule was created and last modified. Reset clears them all. Filters, sorting and paging work the same way in every grid: see Grids: Filters, Sorting and Paging.
Some columns and icons appear only when you have permission to see what they lead to, such as drafts, tests and live evaluations.
Opening a Rule
- Click the Rules tab.
- Click the rule's row. The Rule dialog opens, titled with the rule's name.
The grey line over the dialog's tabs says what the rule is: its ID, its source object and, if it has one, its live version. The names in the line are links to those records.
The Rule dialog has these tabs:
- Stats: the rule's numbers at a glance. It shows how many saved tests the rule has and how many of them have not been run yet, and how many times your application evaluated the rule in production, with a chart of evaluations over the last days. Click a number to open the list it counts. The tab's label repeats two of the numbers.
- Internal Notes: working comments about the rule. Type a note and click Add. See Notes and Descriptions.
- Details: the rule's Rule Type, whether other rules may use it, and its Name and Description, which you can change. Click Save Changes to keep a change. Delete Rule deletes the rule; see Deleting.
The buttons at the bottom of the dialog:
- Show related... opens a menu of lists that belong to this rule: Versions, Drafts, Tests, Live Evaluations and User Activity.
- Test... opens the Test dialog for this rule. See Testing Rules.
- New Draft... starts a draft of a new version of this rule. See Drafts.
- New Rule Version... starts a new version of this rule. See Rule Versions.
Changing a Rule's Name or Description
- Open the rule's Rule dialog.
- Click the Details tab.
- Change the Name or the Description. The name is required: its label is bold, and Save Changes stays off while it is empty.
- Click Save Changes. A notification says the rule was saved.
A rule's name and description are labels only. Changing them does not create a new version, and the rule's logic stays as it is. To change what a rule does, create a new version.