Skip to content
DMN templates

DMN — Deliberately Contradictory: Two Rules, One Input

The other teaching artefact. Under UNIQUE, two rules that can both fire is a contradiction rather than a preference — an applicant aged exactly 65 with a clean file matches two rules that disagree about the answer, and the table does not say which wins. Change the hit policy to PRIORITY or FIRST and the same table becomes well defined, which is the lesson.

Template previewDMN
Premium band — with an overlap (deliberate)DriverPremium bandinformation requirementPremium band — UniqueUAge[17..90]Claims[0..10]Band{ Standard, Loaded, Referred }AnnotationR1[17..25)[0..10]LoadedR2[25..65][0..2)Standardoverlaps R4R3[25..65][2..10]Loadedoverlaps R4R4[65..90][0..10]Referred65 is in this rule AND the two aboveoverlaps R2, R32 overlapping rule pairs · 1 decision · 1 input data · 1 table · 4 rulesR2 and R4 can both fire for the same input — Unique forbids that.R3 and R4 can both fire for the same input — Unique forbids that.

Make it your own.

title "Premium band — with an overlap (deliberate)"

input    Driver "Driver"
decision Band   "Premium band"

Driver -> Band

decision Band "Premium band" {
  hit U
  input  Age    number [17..90]
  input  Claims number [0..10]
  output Band   enum { Standard, Loaded, Referred }

  rule [17..25) | [0..10] -> Loaded
  rule [25..65] | [0..2)  -> Standard
  rule [25..65] | [2..10] -> Loaded
  rule [65..90] | [0..10] -> Referred   // 65 is in this rule AND the two above
}