Purchase Approval (DMN)
Who approves a purchase? The amount and the category give a risk class, and the risk class and the department pick the approver.
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.
Two decisions work together in a decision requirements diagram (DRD). Risk class reads the amount and the category of the purchase request: large purchases and software contracts are high risk, medium amounts medium risk, everything else low. Approver reads the risk class and the department and picks the approver: the team lead, the head of department, the IT manager for IT purchases, or the CFO with a second approval for high risk.
Both tables use the hit policy First, and their last rule has - in every input: so the decision always has a result.
In the process: a business rule task Pick the approver calls the decision and keeps the result as approval. The gateway after it reads ${pi.decisions.approval.approver == 'CFO'} and sends the request to the lane of the approver; ${pi.decisions.approval.secondApproval} adds a second approval.
The Jira fields it reads
| Field | Expression | Values |
|---|---|---|
| Amount (EUR) | pi.fields.customfield_10101 | number |
| Category | pi.fields.customfield_10102.value | select: Hardware, Software, Office, Services |
| Department | pi.fields.customfield_10109.value | select: IT, Sales, Marketing, Finance, HR |
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.approval.
The decisions
Risk class
Hit policy First. Inputs: Amount (EUR) pi.fields.customfield_10101, Category pi.fields.customfield_10102.value.
| # | Amount (EUR) | Category | Risk class | Note |
|---|---|---|---|---|
| 1 | > 25000 | - | "high" | Large purchases |
| 2 | > 5000 | "Software" | "high" | Software is a contract |
| 3 | [1000..25000] | - | "medium" | Medium purchases |
| 4 | - | - | "low" | Everything else |
Approver
Uses the result of: Risk class.
Hit policy First. Inputs: Risk class Risk class, Department pi.fields.customfield_10109.value.
| # | Risk class | Department | Approver | Second approval | Note |
|---|---|---|---|---|---|
| 1 | "high" | - | "CFO" | true | High risk: the CFO, then the board |
| 2 | "medium" | "IT" | "IT manager" | false | IT buys through the IT manager |
| 3 | "medium" | - | "Head of department" | false | Medium risk |
| 4 | - | - | "Team lead" | false | Low risk |
Fits the process template Purchase Request. Read more in Decide with Decision Tables (DMN).