Some logic changes faster than software ships: pricing, eligibility, risk scoring, routing, compliance. Externalizing it into a declarative decision model lets domain experts read — and change — the policy on its own lifecycle.
The application decides when; the rules decide what.
How It Works
- The application gathers input facts (applicant age, order value, region) and calls the engine.
- The engine matches facts against the decision model and returns the outcome plus the rules that fired.
- The decision model lives in its own repository with review, tests, and versioned deployment.
- Standard notation (OMG DMN) keeps models portable and readable by non-programmers.
Mini Example
| Applicant age | Prior claims | Risk class |
|---|---|---|
| < 25 | any | high |
| 25–65 | > 2 | high |
| 25–65 | ≤ 2 | standard |
| > 65 | any | manual review |
Hit policy unique: exactly one row may match; overlaps fail validation.
Failure Modes
- Rules grow into a shadow application: calculations, loops, and data lookups creep in until the model is unreviewed code.
- Overlapping rows under a lenient hit policy make outcomes order-dependent; a harmless edit changes results for unrelated cases.
- Engine and model versions drift: a model authored for one engine version evaluates differently on the next.
- A separate decision service adds a failure point and latency to every request.
Verification
- Static validation in CI checks every table for completeness and overlapping rows.
- A regression suite replays recorded production decisions against every new model version; outcome diffs block deployment.
- Decision latency p99 stays inside its budget under production load.
- An audit query returns the rule version behind any past decision.
Variants and Related Tactics
- Decision tables suit explicit policy; production-rule engines add chained inference at predictability’s cost.
- Policy-as-code engines apply the tactic to authorization and governance decisions.
- Externalized configuration changes values, feature toggles select code paths; this tactic changes decision logic.
- A domain-specific language is the general case when tables turn rigid.
References
- Decision Model and Notation (DMN) — Object Management Group
- RulesEngine — Martin Fowler (2009)
- Real-World Decision Modeling with DMN — James Taylor, Jan Purchase (Meghan-Kiffer, 2016)