1. Home
  2. Blog
  3. Custom Software

Custom Software

What Is a Business Rules Engine and Decision Table? Rule Management, Conflict Checks and Payback Guide

What is a business rules engine and decision table? How to manage discount, limit and approval rules outside code, check conflicts and calculate payback.

Contents 14 sections
  1. What Is a Business Rules Engine?
  2. Should a Rule Live in Code or as Data?
  3. What Parts Does a Business Rule Have?
  4. How Is a Decision Table Built?
  5. Which Rule Applies When Several Match?
  6. How Are Rule Conflicts and Coverage Gaps Found?
  7. How Are Effective Dates and Recalculation Handled?
  8. How Do You Explain Which Rule Was Applied?
  9. How Is a Rule Change Managed?
  10. What Happens as the Number of Rules Grows?
  11. How Is the Payback of Moving Rules to Data Calculated?
  12. What Are Common Mistakes in Business Rule Management?
  13. Custom Software and Rule-Driven Systems with İnovabil
  14. Frequently Asked Questions

Dealer discounts, credit limits, carrier selection, approval thresholds: these are the rules a business changes most often, and in most software they are still buried inside the code. Every change means a developer, a release and weeks of waiting. A business rules engine takes those rules out of the code, keeps them as data and evaluates them the same way on every transaction; the most common way to make rules visible is the decision table.

In this guide we explain the difference between rules kept in code and rules kept as data, how a rule is structured, how a decision table is built, how conflicts and coverage gaps are found, effective dates and recalculation of past transactions, the change process, the point where rules become unmanageable, and the payback calculation. All figures are illustrative; they are not the value of any product or industry.

Key ideaTurning a business rule into data does not make it casually editable; it makes the change versioned, tested, approved and reversible. The gain is less about speed than about visibility: at any moment you can say which rule was applied, on which date, to which input.

What Is a Business Rules Engine?

A business rule states a decision as "if this condition holds, do that": "give an A-class dealer a 12% discount on orders above ₺400,000." A business rules engine consists of a rule store where those statements live and an evaluator that takes an input, finds the rules that match and produces the result. The application does not write the rule itself; it sends the input and receives the decision.

An engine does not have to be a large product. A table, a small service that reads it and a management screen do the job. What matters is that the rule lives apart from the running code and carries a version. The structure that runs the steps and the approval chain is a separate subject; we covered it in our workflow and approval software guide.

Should a Rule Live in Code or as Data?

In code, every change is a software change; as data, a change is a record update, but it demands discipline around versions, tests and permissions. Both can be right; the difference is how often the rule changes and who changes it.

TopicRule in codeRule as data
Change pathDeveloper, release, deploymentAuthorised user, approval, publication
Waiting timeTied to the release cycleAs long as the approval takes
VisibilityOnly people who read the codeThe business can read the table
RiskErrors caught in the release processIf tests and approval are skipped, it goes straight to production
Best suited whenFew rules that rarely changeMany rules that change often

The release process in code is a safety net; with tables you have to build that net yourself. For who may edit what, the least-privilege principle in our role-based access control guide applies.

What Parts Does a Business Rule Have?

A manageable rule is more than a condition and an action; without priority, validity and version, it loses its history every time it changes.

FieldMeaningExample
IdentifierNames the rule unambiguouslyDISC-B3
ConditionThe matching requirementClass = B and amount from ₺150,000 up to ₺400,000
ActionThe result produced on a matchDiscount 8%
PriorityOrder when several rules match20
ValidityStart and end date01.10.2026 to open-ended
VersionIncreases with every changev5

A rule is never deleted; it is given an end date. A deleted rule cannot explain the past.

How Is a Decision Table Built?

A decision table lays conditions out as rows and columns and writes an action at each intersection. It reads better than a heap of "if" statements and its completeness can be checked by counting. The example: discount by dealer class (A, B, C) and order amount band. In every band the lower bound is included and the upper bound excluded.

Dealer classB1: under ₺50,000B2: ₺50,000 up to ₺150,000B3: ₺150,000 up to ₺400,000B4: ₺400,000 and above
A6%8%10%12%
B4%6%8%10%
C2%4%6%8%

The table has 3 classes × 4 bands = 12 cells. A B-class dealer placing a ₺180,000 order matches cell B3: ₺180,000 × 8% = ₺14,400 discount, net ₺165,600.

The completeness check is simple: the product of the condition values gives the cell count; if the filled cells are fewer, there is a gap. With 11 rows, one combination is missing. If the missing cell is class C with B4, a ₺500,000 class-C order gets "no rule found". If the system silently counts that as 0%, the expected 8% is not applied, and the ₺500,000 × 8% = ₺40,000 difference turns into a dispute with the dealer. Stopping the transaction with a warning is safer than falling back to a default value.

Band boundaries are a classic source of errors: if B2 is written "up to ₺150,000" and B3 "from ₺150,000", exactly ₺150,000 sits in two bands or in none. Write the rule "lower bound included, upper bound excluded" above the table and test it. We handled price tiers separately in our B2B price list guide.

Which Rule Applies When Several Match?

In a single table every input falls into one cell. Once campaign and special-agreement rules are added, an input can match several rules; the hit policy decides which one applies, and it is chosen explicitly for each rule set.

PolicyBehaviourWhen it fits
UniqueMore than one match counts as an errorWhen the table must not overlap
First matchThe first rule that fits in an ordered list appliesException lists ordered from specific to general
PriorityThe highest-priority rule appliesWhen you want explicit priority independent of order
AllAll matches apply; results are summed or cappedAdditive rules such as campaigns

Add two rules to the base table: an extra 2% campaign discount on all orders of ₺100,000 and above, and a 12% cap on the total discount. The policy is "all, summed, capped".

  • Class B, ₺180,000: base 8% + campaign 2% = 10%; under the cap, discount ₺18,000.
  • Class A, ₺450,000: base 12% + 2% = 14%; the cap reduces it to 12%, discount ₺54,000. Without the cap it would be ₺63,000; the cap protects ₺9,000.
  • Class C, ₺80,000: below the campaign threshold; only the base 4% applies.

How Are Rule Conflicts and Coverage Gaps Found?

A conflict is two rules matching the same input with different results; a coverage gap is an input that no rule matches. Both are noticed late by eye, so a machine checks them before publication.

  1. Coverage: compute the product of the condition values (3 × 4 = 12), count the filled cells, list the missing ones.
  2. Range continuity: confirm that bands join end to end without gaps and that each boundary belongs to exactly one band.
  3. Conflict: compare rules in pairs. For n rules there are n × (n − 1) ÷ 2 pairs: 66 for 12 rules, 19,900 for 200 rules. The automatic check must be a condition of publication.

How Are Effective Dates and Recalculation Handled?

Rules change, but a past transaction must not. Say the B3 discount drops from 8% to 7% on 1 October 2026. An order was taken on 28 September for ₺180,000 and invoiced on 5 October.

  • Rule at the order date: ₺180,000 × 8% = ₺14,400.
  • Rule at the invoice date: ₺180,000 × 7% = ₺12,600.
  • The difference is ₺1,800; which one is valid depends on company policy and the contract.

Which date governs is a written business decision; for the invoice and contract side, consult your legal counsel and accountant. The technical side: the evaluator takes a reference date on every call and selects the version in force on that date. If the order stores the identifier and version of the rule applied, recalculation always returns the same result.

How Do You Explain Which Rule Was Applied?

"Why did this dealer get 8%?" is asked by support and by auditors. The answer is in the decision record written next to every decision: transaction number, inputs (class, amount), the matching rule identifier and version, the policy, the output and the time. For example "DISC-B3 v4, input class B ₺180,000, output 8%, cap not applied".

The volume is small: 20,000 decisions a month × 0.5 KB ≈ 10 MB, about 120 MB a year. Link personal data by record number and ask your legal counsel about retention periods. We described the design in our audit log guide.

How Is a Rule Change Managed?

The price of turning rules into data is carrying release discipline over to the change. Six steps are enough.

Rule change process: need, decision table, coverage and conflict check, test scenarios, approval and publication, monitoring and rollback
The six steps of a rule change.
  1. Draft: The change is written as a new version; the published one is untouched.
  2. Automatic checks: Coverage, range and conflict checks run.
  3. Test scenarios: A scenario is run for every cell and boundary.
  4. Impact simulation: The new version is applied to past orders and the difference is calculated.
  5. Approval and publication: The business owner and, if needed, finance approve; publication carries an effective date.
  6. Monitoring and rollback: Decisions are watched in the first days; if there is a problem the previous version is restored in one step.

The number of tests can be calculated. In the example, one mid-value scenario for each of the 12 cells: 12. For each of the three band boundaries, two values, just below the boundary and exactly on it, across three classes: 3 × 2 × 3 = 18. Invalid input (negative amount, undefined class): 2. Below the campaign threshold, exactly on it, and the two cases of the cap effect: 4. Total 12 + 18 + 2 + 4 = 36 scenarios. They are written once and run on every change. For techniques see our software testing guide.

Impact simulation informs the decision. If 420 orders fell into the B3 cell last quarter at an average of ₺210,000, the B3 change means 420 × ₺210,000 × 1% = ₺882,000 less discount. Knowing this in advance lets you apply an approval threshold (illustratively, a second approval above ₺500,000 of impact).

What Happens as the Number of Rules Grows?

Once rules are data, their number grows and at some point they become unmanageable. Symptoms: the conflict check returns a long list of warnings on every release, nobody knows why a rule exists, and people fear changing anything.

Combinatorial explosion is the first cause. If 5 conditions each take 4 values, a single table has 4⁵ = 1,024 cells and cannot be read. Splitting the conditions into two meaningful groups and chaining the tables fixes it: a 3-condition table (4³ = 64 cells) plus a 2-condition table (4² = 16 cells) makes 80 cells, each table readable.

Situation (illustrative thresholds)Recommendation
Fewer than 20 rules, fewer than about 18 changes a yearCan stay in code or a configuration file; a separate structure does not pay for itself
20 to 200 rules, frequent changesDecision tables, version and validity management, automatic checks
Over 200 rules, or rules shared by many applicationsSplit tables by domain, assign rule owners, set up a shared rule service

The case for a shared rule service is consistency. If the same rule is coded separately in the portal, the mobile app and the ERP, every change is made in three places. If each copy has a 5% chance of being wrong, the chance that at least one is wrong is 1 − 0.95³ ≈ 14.3%. Rules for products with many options need a different approach, which we covered in our product configurator guide.

Performance can be calculated too. Say evaluation costs 0.004 ms per rule; a 12-rule table takes about 0.05 ms. In a 40-line order with 3 decisions per line (discount, shipping, approval), that is 120 evaluations, about 6 ms. If a single 200-rule table is scanned linearly, each evaluation takes 0.8 ms and the total is 96 ms, 32% of a 300 ms response budget. The fix is to split the table, index by condition and cache the rule set keyed by version number.

How Is the Payback of Moving Rules to Data Calculated?

Payback comes from the number of change requests and the waiting time. Illustrative assumptions: 48 rule change requests a year; in code each request takes 1.5 person-days (development, testing, release), as data 0.25 person-days (table update, scenario run, approval); day rate ₺9,000; setup (migrating existing rules, table screen, checks, log) 45 person-days; monthly operating cost ₺6,000.

Decision table and payback summary: a 12-cell table, 882,000 lira quarterly impact, 10.4-month payback
Illustrative example: table, impact and payback.
ItemCalculationAmount
Yearly effort in code48 × 1.5 = 72 person-days × ₺9,000₺648,000
Yearly effort as data48 × 0.25 = 12 person-days × ₺9,000₺108,000
Yearly difference₺648,000 − ₺108,000₺540,000
Monthly difference₺540,000 ÷ 12₺45,000
Monthly net gain₺45,000 − ₺6,000 operating₺39,000
Setup45 person-days × ₺9,000₺405,000
Payback₺405,000 ÷ ₺39,000about 10.4 months

If requests halve to 24, the monthly net becomes ₺22,500 − ₺6,000 = ₺16,500 and payback stretches to ₺405,000 ÷ ₺16,500 ≈ 24.5 months. Three-year break-even: gain per request (1.5 − 0.25) × ₺9,000 = ₺11,250; three-year cost ₺405,000 + 36 × ₺6,000 = ₺621,000; for N requests a year, 3 × N × ₺11,250 ≥ ₺621,000, so N ≈ 18.4. With fewer than about 18 changes a year, the investment does not repay itself in three years.

Waiting time is a gain not measured in money: if publishing a rule drops from 14 working days, tied to the release cycle, to 1 working day, waiting shortens by (14 − 1) ÷ 14 ≈ 92.9%.

What Are Common Mistakes in Business Rule Management?

  • Using a default value in a gap: Silently applying 0% hides the error for months.
  • Going live without tests and approval: Data rules lack the safety net of code.
  • Leaving the hit policy vague: The same input gets two different answers.
  • Not assigning a rule owner: A rule with no owner goes stale; set a yearly review date.
Read next: How to do software requirements analysis
Read next: What is low-code? A practical guide
We recommend reading: How to Design an E-Commerce Promotion and Coupon Engine: Order, Margin Floor and Abuse Prevention Guide
We recommend reading: How to Set Up Transactional Message Template Management: Email, SMS and Push Templates, Variable Contracts, Versions and Payback Guide

Custom Software and Rule-Driven Systems with İnovabil

At İnovabil our focus is building software from scratch, specific to the company: custom software, ERP, CRM, e-commerce, web, mobile and integration. We recommend settling in requirements analysis which rule stays in code and which is kept as manageable data, together with how often it changes and who owns it. The approach we describe is not an off-the-shelf product; it is applied according to the project's requirements.

We built CRM, purchasing and mobile for Avcılar İnşaat; a purchasing system for İZBAN; logistics and shipment planning with wholesale order management for Karyak; and warehouse management plus a complaint and support system for Sleepy. Send us a list of your frequently changing rules and we will assess together which suit a table.

Read next: Our software development process, from analysis to release

Frequently Asked Questions

What is a business rules engine and what is it for?

It is a structure that separates business rules from the application code, stores them as data and finds which rules apply to an input. It lets you manage decisions such as discounts, limits and approval thresholds without waiting for a software release.

What is a decision table?

A table whose rows and columns hold conditions and whose intersections hold a result. Empty cells are found by counting and the rules read at a glance.

Should every business rule become a decision table?

No. Rules of the same shape that change often suit tables. Rarely changing rules can stay in code; for multi-step processes and complex algorithms, a workflow or custom code is the better fit.

What happens to past orders when a rule changes?

They must not be affected. Every rule has an effective date and a version; the evaluator picks the version at the order date and the order stores the rule identifier it used. Which date governs is a business and legal decision.

When does a rules engine pay for itself?

It depends on change frequency. In the example, with 48 changes a year payback is about 10.4 months; below about 18 changes a year the investment does not repay itself in three years.

Let's talk about your project

Tell us briefly about the software you have in mind; we'll listen and prepare a tailored roadmap and proposal.

Get a quote