DMN — Shipping Band by Weight and Destination
Two enumerated columns and one numeric one, covered completely. The pattern worth learning is the declared domain: weight is bounded [0..30] and destination is enumerated, so 'complete' means something — without the declaration the checker could only say it did not know.
What this template contains
- Source
- 15 lines
When to use it
Choose this when a decision depends on combinations of input values. Weight and destination select a shipping band; replace the example domains and rules with your own, then inspect gaps or overlaps under the chosen hit policy. Compare it in business process diagram templates
Make it your own.
title "Parcel shipping band"
input Parcel "Parcel"
decision Band "Shipping band"
Parcel -> Band
decision Band "Shipping band" {
hit U
input Weight number [0..30]
input Zone enum { Domestic, EU, World }
output Band enum { Letter, Small, Standard, Freight }
rule [0..2] | Domestic -> Letter
rule [0..2] | EU, World -> Small
rule (2..10] | Domestic, EU -> Standard
rule (2..10] | World -> Freight
rule (10..30] | Domestic, EU, World -> Freight
}