Decision Tables Overview
A decision table evaluates rules against supplied input data and returns the applicable output values. Koodisi provides a table editor, validation and saved tests, environment releases and a DecisionTable workflow activity.
The table returns data. The workflow can map that data and call another process. These are separate steps in the platform.
Decision tables in Koodisi
Decision tables suit policies that can be expressed as conditions and expected outcomes. Workflows supply the surrounding data retrieval, transformations, process calls, waiting and retries. A classification or routing decision can therefore remain separate from the process that uses it.
When to use decision tables
| Use case | Example inputs | Example outputs |
|---|---|---|
| Eligibility | Age, service date, account status | Eligible or ineligible, with a reason |
| Routing | Request amount and customer tier | Queue or process to use |
| Classification | Product type and transaction value | Category or review level |
| Policy thresholds | Date, amount or quantity | Applicable band or treatment |
Inputs, outputs and rules
| Table part | Meaning in Koodisi | DMN term |
|---|---|---|
| Input column | Defines a fact to evaluate and its data type, for example amount. | Input clause |
| Condition cell | Tests that input for one rule, for example >= 100. | Input entry / unary test |
| Output column | Names a returned value and its type, for example route. | Output clause |
| Output cell | Provides a value or supported expression for a matching rule. | Output entry |
| Rule row | Combines its conditions and output values. All its conditions apply to the same input record. | Decision rule |
| Hit policy | Determines which matching rules contribute to the result. | Hit policy |
A rule matches when all its condition cells are satisfied. In the routing example below, R2 requires both an amount of at least 100 and the gold tier. Matching one cell in R2 and another cell in R3 does not combine them into a match. The hit policy determines the result when more than one complete row matches.
Decision table example
This example selects a route using an amount and a customer tier. It uses the Unique hit policy, so one input can match at most one rule. These rules illustrate the feature and are not a customer policy.
| Rule | amount | customerTier | route |
|---|---|---|---|
| R1 | [0..100) | - | standard |
| R2 | >= 100 | gold | priority |
| R3 | >= 100 | basic | review |
The range [0..100) includes zero and excludes 100. A dash is a wildcard. An amount of 150 with tier gold matches R2 and returns route = priority.
| Input | Returned route or outcome |
|---|---|
| 50, gold | standard |
| 150, gold | priority |
| 150, basic | review |
| 150, unknown tier | No matching rule |
| Invalid amount text | An error for that input |