Decision Tables Explained
Decision Tables are one of the most commonly used Expressions and offer great flexibility with the definition of rules allowing for logic expression that are logically 'OR-ed' which is not possible in a number of the other expression types.
This diagram demonstrates the anatomy of the Decision Table, the parts of which are discussed in the subsequent sections. A Decision Table is essentially a set of rules that will be evaluated when the Decision is being executed. Each rule contains any number of inputs, and when the logic is executed and a rule is selected the outputs defined against that rule will be returned. The input expressions in a given rule are combined as a logical 'AND', so every input expression in a rule must evaluate to True before the rule is selected.
In this example there are two input columns - Age and Medical History. For the output of Applicant Risk Factor = Medium, the Applicants Age <25 AND their Medical History must be Fair.
Each Decision Table must have a Hit Policy that specifies how the rules defines in the table will be evaluated. The default is 'U', signifying 'Unique', which means that rules must not overlap and one and only one rule will be selected. There are a number of Hit Policies that return a single row (Unique, Any, Priority, First) and a number that return multiple rows (Output Order, Rule Order, Collect). Hit Policies are explained in greater detail in the later topic Hit Policies.
List of Rules
A Decision Table is essentially a set of rules that define inputs and outputs. The rules can be orientated horizontally or vertically and can contain any number of Input expressions and one or more Output expressions.
List of Input Clauses
Each Input Clause consists of an expression defined in each rule of the table. The expressions generally comprise one or more input values, e.g. 'Age>25'.
List of Output Clauses
Each Output Clause consists of an expression that can be a simple element or comprising one or more input values, e.g. 'High, Medium, Low'.
The Decision Table toolbar contains a number of facilities for working with the tables, including adding rows and columns, merging cells, and validating the table for syntactic and logical correctness. For more details of the Decision Table toolbar see the Decision Table Editor Toolbar Help topic.