Warranty Check (DMN)
Is a claim in warranty, and what happens with it? A date calculation and a table with the hit policy Priority decide.
Download Decision Template for Free
Import the DMN file when you create a decision in Flower BPM, adjust the rules, publish, and call it from a business rule task. Decisions run with Flower BPM Advanced and on Data Center.
In warranty is a literal expression with FEEL dates: the purchase date plus two years (three for electronics) must not be before today. Outcome reads the result and the kind of damage. Several rules may fit; the hit policy Priority takes the outcome that comes first in the list Reject, Replace, Repair, Charge. So misuse is rejected even in warranty.
In the process: a business rule task Check the warranty keeps the result as warranty. A gateway reads ${pi.decisions.warranty.outcome == 'Replace'} and the other outcomes.
The Jira fields it reads
| Field | Expression | Values |
|---|---|---|
| Purchase date | pi.fields.customfield_10107 | date |
| Category | pi.fields.customfield_10102.value | select: Electronics, Furniture |
| Damage | pi.fields.customfield_10108.value | select: Defect, Total loss, Misuse |
The custom field ids are examples: replace them with the ids of your fields. The result is kept at the process instance as pi.decisions.warranty.
The decisions
In warranty
A literal expression (FEEL):
date(pi.fields.customfield_10107) + (if pi.fields.customfield_10102.value = "Electronics" then duration("P3Y") else duration("P2Y")) >= today()Outcome
Uses the result of: In warranty.
Hit policy Priority. Inputs: In warranty In warranty, Damage pi.fields.customfield_10108.value.
| # | In warranty | Damage | Outcome | Note |
|---|---|---|---|---|
| 1 | - | "Misuse" | "Reject" | Misuse is never covered |
| 2 | true | "Total loss" | "Replace" | Total loss in warranty |
| 3 | true | - | "Repair" | In warranty |
| 4 | false | - | "Charge" | Out of warranty |
Fits the process template Check Warranty Obligations. Read more in Decide with Decision Tables (DMN).