Browsing Fields
Before you write a rule, it helps to know what the source object holds: which fields there are, what each one means, and what values it accepts. The Source Fields tab, also called the Fields View, shows all of it in one tree. You use it to find the right field for a condition, to check a field's allowed values or format, and to see which methods and actions an execution rule can use.
These parts of the repository show a source version's members:
- The Source Fields tab of the Source Version dialog: the tree described on this page. The same tab is in the Rule Version dialog, the Draft dialog and step 2 of the New Rule dialog, where it shows the source version that rule is written against.
- The Source XML tab: the same definition exactly as your application wrote it.
- The Full View: both tabs side by side in a larger dialog.
Open the Fields View
- Click the Source Versions tab and click a version's row. The Source Version dialog opens on its Source Fields tab.
- Click a node's row to close it, and click it again to open it.
What the tree shows
At the top is the source object itself. The line under its name says how your application describes it, such as the class it comes from and, where the source has them, the AI aliases and description that help the AI understand it.
Under it are three groups:
- Fields: the values a rule can look at or set.
- In-Rule Methods: values worked out when the rule runs. A method can take parameters, listed under it as Parameter 1, Parameter 2 and so on, followed by what it Returns.
- Actions: what an execution rule can make happen, with their parameters.
A group with nothing in it says - none -.
Each member shows up to three lines:
- Its name, as the Rule Editor shows it.
- Description, when it has one.
- Data Type, and what a value must respect: a text's Max Length, a number's Min, Max and whether it takes decimals, a date's or a time's Format. A duration also says Time Type: Duration.
A method or an action also says whether tests replace it with a stand-in that your application provides: Test method: with its name, or No test method. See Testing Rules.
The grey ⋯ at the end of a line holds every other setting. Hover over it to read them, such as the member's declared name, the name your application's programmers use for it, and whether a rule can set it.
Some fields group others. A field that holds fields of its own opens like a group. A Collection is a list of items, such as the lines of an order; its items are described by a source object of their own, further down the tree.
Lists of values
Below the source objects are the lists that fields take their values from.
- An enumeration is a fixed list that is part of the source version. Each member shows its number in brackets.
- A data source is a list your application supplies when it is needed. It starts closed: click it to load its current items. Each item shows its key in brackets. These are the same items the Rule Editor offers.
A field that takes its values from a list shows the list's name as a blue link beside its own. Click the link to jump to the list; it is highlighted for a moment.
The Source XML tab
Source XML shows the version's definition exactly as your application wrote it, indented and in colour. You do not need it to write rules. It is useful when you talk to the people who build your application, or when you need a setting the Fields View does not show. The copy icon in its top right corner copies the definition exactly as it is stored.
Use the Full View
- Click the Full View icon in the bottom right corner of either tab. A larger dialog opens with the Fields View and the Source XML side by side.
- Click Back to return to the Source Version dialog.