About Decision tables
Use a decision table to derive a value that has one of a few possible outcomes, where each outcome can be detected by a test condition. A decision table lists two or more rows, each containing test conditions, optional actions, and a result.
The following tabs are available on this form:
At run time, the system evaluates the rows starting at the topmost row:
- If any conditions in a row evaluate to false, processing continues with the next row. The Actions and Return columns for that row are ignored.
- If all the conditions in a row evaluate to true, then the Actions
and Return columns of that row are processed. What happens next
depends on the Evaluate All Rows check box on the
Results tab:
- If the Evaluate All Rows check box is not selected, processing ends and the system returns the value in the Return column as the value of the entire rule.
- If the Evaluate All Rows check box is selected, processing continues through all remaining rows, performing the Actions and Return calculations for any rows for which the conditions are all true.
- If no row in the table has all conditions evaluate to true, the system returns a default result.
- When a cell with an OR condition has an empty cell, the parser ignores that cell and parses only the cell that contains a value.
- In a table with text properties and an operator that overrides the default operator (=),
an empty cell is treated as "". Additionally, the following code is generated:
columnProp.compareTo("")>0)
. If the property type is not text, an empty cell generates a validation error.
Where referenced
Four other types of rules can reference decision tables:
- In a flow rule, you can reference a decision table in a decision shape, which is identified by the Decision shape .
- In an activity, you can evaluate a decision tree by using the Property-Map-DecisionTable method.
- A Declare Expression rule can call a decision table.
- A collection rule can call a decision table.
Access
Use the Application Explorer to access decision tables that apply to work types in your application. Use the Records Explorer to list all the decision tables available to you.
Development
When creating a rule that is to return only one of a small number of possible values, complete the Results tab before the Table tab.
After you complete initial development and testing, you can delegate selected rules to line managers or other non-developers. Consider which business changes might require rule updates and if delegation to a user or group of users is appropriate. For more details, see Delegating a rule or data type.
Category
Decision table rules are instances of the Rule-Declare-DecisionTable class. They are part of the Decision category.