DMN — Stacking Discounts (COLLECT with a sum)
The hit policy that changes what an overlap means. Under COLLECT-sum, two rules firing together is the design rather than a contradiction, so overlaps are counted and reported as intended rather than accused — which is the distinction almost every decision-table tool gets wrong.
Make it your own.
title "Order discount"
input Order "Order"
input Customer "Customer record"
decision Discount "Discount percentage"
Order -> Discount
Customer -> Discount
decision Discount "Discount percentage" {
hit C+
input Value number [0..100000]
input Tier enum { Bronze, Silver, Gold }
input Promo boolean
output Pct number [0..100]
rule - | - | - -> 0 // base: everything matches this
rule [1000..100000] | - | - -> 5 // volume
rule - | Silver | - -> 3 // loyalty
rule - | Gold | - -> 7
rule - | - | true -> 10 // campaign
}