All resources
Design5 min read

Decision tables with DMN and FEEL

Move business rules out of code and into a table anyone can read: build a discount table, test it, and call it from a process.

In short

  • 01

    Rules live in a table, not in gateway conditions or worker code.

  • 02

    Test a table with sample values before a process uses it.

  • 03

    A business rule task runs the table and stores its outputs as variables.

A decision table takes input values, finds the rule that matches, and returns outputs. DMN is the standard for the table; FEEL is the small expression language used inside its cells.

Example: a discount table

RegionAmount→ Discount
"EU"> 10000.2
"EU"-0.05
--0

Read each row as a rule. An EU order above 1000 gets 20%; any other EU order gets 5%; everything else gets nothing. A dash means "any value".

What goes in a cell

CellMeaning
"EU"Equals the text EU
> 1000Greater than 1000 (also <, >=, <=, !=)
[100..500]Between 100 and 500
-Matches anything
amount * 0.1An output can be a calculation

Hit policies

The hit policy decides what happens when more than one rule matches. Orkovia supports the nine DMN hit policies — for example Unique (only one rule may match), First (the first matching rule wins) and Collect (return every match).

Build, test, use

1
Build the table in Studio
Add input and output columns, then rules. You can also import an existing .dmn file.
2
Test it
Evaluate the table with sample values. The trace view shows which rules matched and why.
3
Call it from a process
Add a business rule task and point it at the decision. When the task runs, every output column becomes a process variable.
curl -X POST http://localhost:3000/api/v1/decisions/<id>/evaluate \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"variables": {"region": "EU", "amount": 1500}}'
Decision tables, literal expressions, decision requirement graphs and decision services are supported. Boxed context, invocation and relation expressions are not yet.

See it on your own process

Book a walkthrough with the Orkovia team.

Request a Demo