A Decision Table is the most common boxed expression in DMN. It represents a rules engine where inputs are matched against rules to determine an output.
Structure
- Hit Policy: Determines how many rules can match and how the result is aggregated.
- Input Clauses: The columns defining conditions (e.g.,
Age, Risk Level).
- Output Clauses: The columns defining results (e.g.,
Approved, Interest Rate).
- Rules: The rows containing input entries (unary tests) and output entries (expressions).
Hit Policies
| Code | Name | Description |
|---|
| U | Unique | Overlap is forbidden. Only one rule can match. |
| A | Any | Rules may overlap, but matching rules must produce the same output. |
| P | Priority | Rules may overlap. The output is selected based on the priority of the output values. |
| F | First | Rules are evaluated top-to-down. The first match wins. |
| C | Collect | All matching rules returned (as a list). |
| C+ | Collect (Sum) | Returns sum of outputs. |
| C< | Collect (Min) | Returns minimum output. |
| C> | Collect (Max) | Returns maximum output. |
| R | Rule Order | Returns list of matches in rule order. |
Example
| U | Age | Credit Score | Loan Approved |
|---|
| 1 | < 18 | - | false |
| 2 | >= 18 | > 700 | true |
| 3 | >= 18 | <= 700 | false |