Decision Tables
A decision table is the most common logic of a DMN decision. It lists rules: each rule compares the inputs with tests, and when all tests of a rule match, the rule gives its output values. How many rules may match, and which result counts then, is the hit policy of the table.
Anatomy of a Table
An example: the discount of an order.
| F | Customer level | Order amount | Discount (%) | Annotation |
|---|---|---|---|---|
| 1 | "gold" | >= 1000 | 15 | Large orders of gold customers |
| 2 | "gold" | - | 10 | |
| 3 | "silver" | >= 1000 | 5 | |
| 4 | - | - | 0 | Anything else |
| Part | Where | What it is |
|---|---|---|
| Hit policy | Top left cell (here F, First) | How many rules may match and which result counts. See Hit Policies. |
| Input | Column header (Customer level, Order amount) | A label and an input expression: the value the rules test, written in FEEL, for example Customer level (the result of a required decision) or pi.fields.customfield_10030 (a number field of the process instance in Flower BPM). Optional: a type (string, number, …) and the allowed input values. |
| Output | Column header (Discount) | A name for the result, optional a type and the allowed output values. A table can have several outputs; then the result is a context with one entry per output. |
| Rule | One row | A number, one input entry per input, one output entry per output, and optional annotations. |
| Input entry | Cell under an input | A unary test: does the value of the input pass this test? |
| Output entry | Cell under an output | A FEEL expression: the value of the output when the rule matches. |
| Annotation | Extra column | A comment for people, not evaluated. |
A rule matches when every input entry of the row matches. The cells of one row are joined with and; to express or, write several rules, or several values in one cell ("gold", "silver").
Input Entries: Unary Tests
An input entry is a short test of the input value. The value itself is not written, it is implied (in full FEEL it is available as ?).
| Input entry | Matches when the input value … | Example |
|---|---|---|
- (or empty) | is anything | Any customer level |
"gold" | equals the value | Level is gold |
100 | equals the number | Exactly 100 |
< 100, <= 100, > 100, >= 100 | compares as written | Below 100 |
[100..500] | lies in the range, both ends included | 100 to 500 |
(100..500) or ]100..500[ | lies in the range, both ends excluded | Above 100 and below 500 |
[100..500) | lies in the range, the start included and the end excluded | 100 up to, not including, 500 |
"gold", "silver" | equals one of the values | Gold or silver |
not("gold") | does not pass the test inside | Every level except gold |
not("gold", "silver") | passes none of the tests inside | Neither gold nor silver |
null | is null (missing) | Field not filled |
date("2026-12-31"), < date("2027-01-01") | compares as a date | Before 2027 |
? > 3 and ? < 10 | makes the FEEL expression with ? true (full FEEL) | Between 3 and 10 |
contains(?, "urgent") | makes the function true (full FEEL) | The text contains “urgent” |
The simple forms (values, comparisons, ranges, lists, not(...), -) are S-FEEL and understood by every DMN engine. Expressions with ? need an engine with full FEEL.
Output Entries
An output entry is a FEEL expression, usually a literal: "gold", 15, true, null. It can also compute: order.amount * 0.1, "Team " + region. When a table has several outputs, each rule fills each of them.
Allowed Values and Default Output
- Input values and output values list the values a column may have, for example
"gold","silver","standard". Tools use them to check cells and to offer choices. The order of the output values also sets the priority for the hit policies Priority and Output order. - A default output entry is the value of an output when no rule matches.
Complete Tables, Without Overlaps
Two questions every table must answer:
- Is it complete? Every possible combination of input values should match some rule. Otherwise an input gets no result. The simplest way: a last rule with
-in every input cell, combined with the hit policy First. - Do rules overlap? With the hit policy Unique, two rules that match the same case are an error. Check the boundaries of ranges:
< 1000and>= 1000meet without a gap or an overlap;<= 1000and>= 1000overlap at 1000.
Keep tables small and readable: few inputs, the most important input first, and ranges that meet exactly. When a table grows beyond about 20 rules, split the decision into two that require each other in the DRD.
Table Orientation
DMN allows rules as rows (the usual form, shown above), rules as columns, and a crosstab with two inputs on the two axes. Most tools, dmn-js among them, offer rules as rows.
In Flower BPM
| Part | What Flower BPM does |
|---|---|
| Input expression | Evaluated with FEEL. Besides the results of required decisions, the names of the process are available: pi (the process instance, pi.fields.<field>), cur, par, model and pi.decisions. An input without an expression is an error that names the input. |
| Input entry | Evaluated as a unary test with FEEL, including ?. Empty and - match everything. An entry FEEL cannot read is an error that names the rule, the column and the text, for example The input entry of rule 1, column “Order amount” of the decision “Discount” cannot be read (>>> 3). |
| Output entry | Evaluated with FEEL. An empty output entry gives null. |
| Output name | The key of the result: the name of the output, else its label, else result (one output) or output1, output2, … |
| Result of a table | Inside the DMN as in the standard: with one output the value itself, so a decision that requires it reads Customer level = "gold" in a cell or Discount + 1 in a literal expression; with several outputs a context (Discount.percent); with a multiple hit policy a list of values ([1, 2]), with an aggregation the aggregated value; without a match null (or the empty list). Toward the process always a context of the outputs, also with one output: a gateway reads ${pi.decisions.discount.percent >= 10}, and Evaluate shows the result that way. |
| Date fields | Jira sends date fields as text. Write the input expression as date(pi.fields.duedate); a date test such as < date("2027-01-01") never matches the text itself. |
| Type of an input or output | Kept, not checked: a value of another type is compared as it is. |
| Input values | Kept, not checked. |
| Output values | Used for the order of Priority and Output order, not checked otherwise. |
| Default output entry | Used when no rule matches: the result is a context of the default output entries (an output without one gives null); for the multiple hit policies a list with this context; with sum, minimum or maximum the default of the first output; a count gives 0. Without any default output entry: null, an empty list, or 0 for a count. |
| Annotations | Kept, not evaluated, as in DMN. |
| Orientation | Rules as rows (the DMN modeler of Flower BPM). |
The result of a table with one matching rule is a context of its outputs, for example {"percent": 10}; a gateway reads it as ${pi.decisions.discount.percent >= 10}. The DMN modeler offers the fields of the process instance in the cells: type pi. or cur., or press Ctrl+Space. See Decide with Decision Tables (DMN).