DMN — Holiday Entitlement (the DMN specification's own example)
The example the DMN specification itself uses to introduce COLLECT with a maximum: base entitlement plus separate age and service allowances, where the answer is the largest matching rule rather than the sum. Complete over both declared domains.
What this template contains
- Source
- 16 lines
Make it your own.
title "Holiday entitlement"
input Employee "Employee record"
decision Days "Holiday days"
Employee -> Days
decision Days "Holiday days" {
hit C>
input Age number [16..70]
input Service number [0..50]
output Days number [22..30]
rule [16..70] | [0..50] -> 22 // base entitlement, always applies
rule [16..70] | [30..50] -> 30
rule [60..70] | [0..50] -> 25
rule [16..17] | [0..50] -> 25
rule [16..70] | [15..50] -> 27
rule [45..70] | [15..50] -> 29
}