What is DMN?
Decision Model and Notation (DMN) is an industry standard created by the OMG® (OMG) that provides a common notation for decision modeling. It bridges the gap between business decision design and decision implementation by providing a notation that’s readable by both business and technical users. DMN is designed to:- Document decision-making processes clearly and precisely
- Enable collaboration between business and technical teams
- Create executable decision models that can be automated
- Ensure decision logic is testable, auditable, and traceable
Core Components of DMN
DMN models consist of two key elements:- Decision Requirements Diagram (DRD) - The visual representation of the decision model
- Decision Logic - The detailed specifications of how decisions are made
Decision Requirements Diagram (DRD)
A DRD shows the structure of a decision model using these elements:- Decision Nodes (rectangles): Represent the decisions to be made
- Input Data (ovals): Represent information used to make decisions
- Knowledge Sources (documents): Represent sources of knowledge (policies, regulations, etc.)
- Business Knowledge Models (rounded rectangles): Represent reusable decision logic
- Information Requirements (solid arrows): Show dependencies between decisions
- Knowledge Requirements (dashed arrows): Show dependencies on business knowledge models
- Authority Requirements (dotted arrows): Show dependencies on knowledge sources
Decision Logic
Decision logic in DMN can be expressed in several ways:- Decision Tables: Structured way to represent complex decision logic
- Literal Expressions: Simple expressions or calculations
- Function Definitions: Reusable logic functions
- Invocations: Calls to Business Knowledge Models
- Contexts: Collections of local variables and results
- Lists: Collections of items
Decision Tables
Decision tables are a powerful way to express complex business rules. They consist of:- Hit Policy: Determines how rules are evaluated (unique, first, collect, etc.)
- Input Columns: Conditions to be checked
- Output Columns: Actions or results
- Rules: Rows that connect inputs to outputs
This table uses a Unique (U) hit policy, meaning only one rule will match for any given input.
FEEL - Friendly Enough Expression Language
DMN uses a language called FEEL (Friendly Enough Expression Language) for expressing decision logic. FEEL is designed to be:- Readable by business users
- Precise enough for execution
- Capable of expressing complex logic
- Simple calculations:
Base Premium * Risk Factor + 10 - Conditional logic:
if Age < 25 then "Young Driver" else "Regular Driver" - List operations:
some item in [1, 2, 3] satisfies item > 2 - Date handling:
date("2023-04-15") + duration("P3M")(adds 3 months to the date)
DMN Execution
DMN models are not just documentation—they’re executable specifications. When a DMN model is executed:- Input data is provided to the model
- The model evaluates decisions in dependency order
- Decision logic is applied according to the specified rules
- Results are returned for all requested decisions
Benefits of Using DMN
DMN offers numerous advantages over traditional approaches to defining business rules:- Business-IT Alignment: Common language for business and technical stakeholders
- Separation of Concerns: Decision logic separated from process flow
- Transparency: Clear documentation of decision criteria and logic
- Consistency: Standard approach to modeling decisions across the organization
- Modularity: Reusable decision components
- Testability: Easy to validate with test scenarios
- Adaptability: Easier to change decision logic without affecting applications
- Interoperability: Standard format works across compliant tools and engines
DMN in the Apache KIE Ecosystem
Within the Apache KIE ecosystem, DMN is fully supported with these features:- Visual modeling through Aletyx Playground
- Full compliance with the DMN specification
- Integration with other standards like BPMN
- Cloud-native deployment options
- Testing and validation tools
- Versioning and governance capabilities