Skip to content
BOE Docs
Learn

What is a business rule engine

A rule engine is a place where the decisions your business makes are written down once, in plain pieces, and run the same way every time.

A coffee shop loyalty card

A coffee shop gives you a card. Buy nine drinks and the tenth is free. That sentence is a rule. The barista applies it by counting stamps. The owner can change it to “buy seven” on Monday.

What the barista looks at is a set of facts: how many stamps, which drink, what day. What comes out is a decision: free or paid.

Now a lender

A lender has the same shape with higher stakes. Facts: income, missed payments, the amount requested. Rules: income adds points, missed payments take points off, above 70 is approved. Decision: approve, review or decline.

Months later, a customer asks why they were declined. The lender needs the exact rules that ran, in the version that was live that day.

Where rules are kept

Many products keep rules inside if and else branches. One sits in the checkout service. Another sits in a nightly job. A third sits in a spreadsheet that gets emailed around.

  • Spread across servicesThe same rule is copied in three places and drifts apart.
  • Slow to changeA new threshold waits for a developer, a review and a release.
  • Hard to explainNobody can say which branch fired for one customer last spring.

How a rule engine works with your code

Your code decides when a decision is needed. The rule engine holds what the decision is. Your code sends facts and receives an answer. The rules sit in one versioned place that a product owner can read.

How a decision flows
  1. FactsWhat you know right now.
  2. RulesetYour rules, versioned.
  3. EngineRuns the rules.
  4. Decision + lineageThe answer and the reasons.

Seven words to know

  • FactOne piece of information you send in. Income of 82,000 is a fact.
  • RuleOne small decision step. Two missed payments takes 30 points off.
  • RulesetA named group of rules that work together, such as credit-score.
  • Engine modeThe kind of engine a ruleset uses, such as scoring or eligibility.
  • VersionA saved snapshot of a ruleset. Old versions stay available.
  • EnvironmentDev is where you build. Production is where real traffic runs.
  • LineageThe record of which rules fired, in which version, for one decision.