Your First Rule
This page walks you through one rule from start to finish: you pick a source object, write a rule in the Rule Editor, try it on sample values, save it, and make it live so that your application starts using it. It takes about five minutes and touches every main part of the Rule Repository, so it is the best place to start.
On the way you use these parts of the repository:
- The Source Objects tab and the Source Object dialog, where every rule starts: a rule is always written against one source object, the data it looks at.
- The New Rule dialog, which takes you through three steps: what kind of rule to write, the rule itself, and its name.
- The Rule Editor, inside step 2, which builds the rule from menus of the source object's fields, so you never type a field's name.
- The Test dialog and the Test Result dialog, where you enter sample values, run the rule and see what it decides and why.
- The Rule Version dialog, where you make the saved version live.
Open a source object
- Click the Source Objects tab. The grid lists every source object in the repository.
- Click the row of the source object your rule is about. The Source Object dialog opens on its Stats tab.
Choose what kind of rule to write
- Click New Rule... at the bottom of the dialog. The New Rule (Step 1 of 3) dialog opens with your source object already selected in Source.
- In Source Version, select the version marked (Live). That is the definition your application currently uses.
- In Rule Type, select Evaluation Type. An evaluation rule answers a question with yes or no.
- In Is Reusable Rule?, select No. Can Other Rules Execute It? applies to execution rules only, so leave it as it is.
- Click Next. Step 2 opens on the Rule Editor tab.
Write the rule
- Click anywhere in the editor's area. The editor writes Check if and opens a menu of the source object's fields.
- Select a field, then an operator such as is or is greater than, then a value. For a field with a fixed list of values, the editor offers the list; for a number, a text or a date, it opens a box or a picker where you type or pick the value. Press Enter to finish a typed value.
- The editor now offers and and or. Select and to add a second condition, and build it the same way.
The grey line over the rule, called the Help String, always tells you what you can do next. When the rule says what you want, go on.
Try it on sample values
You can run the rule on values you make up before you save anything.
- Click Test.... The Test dialog opens. On the left are the fields your rule uses, each with a box for its value. On the right is your rule.
- Click the box beside each field and enter a value: pick one from a list, or type it and press Enter.
- Click Run. The Test Result dialog shows each condition with the values it compared, and the rule's result, TRUE or FALSE.
- Click Back to Test to try other values. When you are done, close the Test dialog with its X. The repository asks whether to close it and lose your changes: the question is about the test values, not your rule. Click OK to return to the New Rule dialog.
You cannot save a test of a rule that is not saved yet. Once the rule is saved, open Test... from its version to save tests. See Saved Tests.
Save the rule
- Click Next. The repository checks the rule. If something is unfinished or wrong, the editor marks it in red, says what is wrong when you hover over it, and you stay on step 2. Otherwise step 3 opens.
- Type a Rule Name and a Rule Version Name, such as "v1". Their labels are bold because they are required. The descriptions and internal notes are optional.
- Click Create Rule. The repository asks Ready for production?
- Click Save Version. A notification says that the rule was created, and the dialog closes. Your rule is now at the top of the Rules grid.
Save & Go Live would save the version and make it live in one step; this page does it in two so that you see both. If you are not allowed to make versions live, the repository asks instead whether to request approval. See Approvals.
Make it live
A rule's live version is the one your application uses. Until a version is live, your rule exists only in the repository.
- Click the Rule Versions tab and click your rule's version. The Rule Version dialog opens. The line over its tabs says This rule version is not Live.
- Click Go Live. A Pay Attention confirmation says which version goes live and which one it replaces, if any. You can add an internal note. Click Next.
- Type live in the box and click Go Live.
The dialog's line turns green and says This rule version is Live. From now on, your application runs this version. Making a version live needs permission: without it, Go Live is shown but turned off, and its tooltip says that you do not have permission to do this.