How Do I Extract Business Rules from My Old System with AI?

AI reads your old system's code and writes each business rule as a clear sentence, then the process owner confirms it. Part 4 covers the method, the EARS format, the Thought Machine and Amazon example, and a one-rule test on 3 invoices.

Origami TeamEditorial Team
7 min read
How Do I Extract Business Rules from My Old System with AI?

You extract the business rules from your old system in 3 steps: AI reads the code and writes each rule as a clear sentence linked to the line it came from, the person who owns the process reviews it and confirms or corrects it, and you compare it with what the system actually does on real invoices. A tool such as AWS Transform for mainframe writes rules as reviewable requirements, and in Thought Machine's announcement with Amazon on 29 September 2026 extraction runs through 4 stages ending in human sign-off. Write no new code until the rules are confirmed.

In part 3 you came out with an inventory and a provisional decision for each system. The systems you decided to rebuild or convert are the ones that need this step first.

Why business rules are the most valuable thing in your old system

A business rule is the way your company calculates or decides something: how a wholesale customer's discount is worked out, when a late fee is added, who approves a purchase order above a certain limit, how an installment amount is rounded. These rules built up over years of changes, and many of them were never written in any document.

  • In the code: conditions and calculations a developer wrote years ago at the request of a manager who has since left.
  • In the database: price tables, rates and limits someone edits by hand without knowing what depends on them.
  • In people's heads: the exceptions the accountant handles by hand because the system does not.
  • In spreadsheets: formulas that fill the gaps in the system, as we explained in which sheet is the system.

If you rebuild the system without these rules, you build a new system that calculates differently, and you only find out when a customer disputes an invoice. The rules are what must move; the old programming language is only the container.

How AI reads the code and writes the rules

Extracting rules used to be long manual work: a developer reading the code line by line and writing down what they understood. Today's tools read all of the code, follow where every number comes from and where it goes, then write what they find in plain language. One example: Amazon says on the AWS Transform for mainframe page that the service extracts every business rule from the source code and traces it to its origin, then generates development-ready requirements your team can review, each one traceable back to the code it came from. That is Amazon's description of its service, not a guaranteed result.

The format a rule is written in matters. One well-known format is EARS, the Easy Approach to Requirements Syntax, developed by Alistair Mavin and colleagues at Rolls-Royce and first published in 2009. The idea is that every rule is written in a fixed order: the state, then the trigger, then what the system must do. It has 5 basic patterns; here are illustrative business examples:

PatternFormIllustrative example
UbiquitousThe system shall...The system shall show the customer number on every invoice
State drivenWhile..., the system shall...While a customer account is suspended, the system shall reject any new order for it
Event drivenWhen..., the system shall...When a purchase order exceeds the approval limit, the system shall route it to the finance manager
Optional featureWhere..., the system shall...Where the customer is in the wholesale group, the system shall apply the wholesale price list
Unwanted behaviourIf..., then the system shall...If an invoice is unpaid after the agreed period, then the system shall add the late fee

The value of this format is that the process owner can read and judge it without knowing how to program. One sentence per rule, and they answer yes, no or incomplete.

An example from banking: business intent, not line-by-line translation

The clearest recent example comes from banking, where interest, fee and repayment rules have lived in COBOL code on mainframes for decades. COBOL is an old programming language that still runs many systems in banking and insurance. In its announcement of 29 September 2026, Thought Machine, a banking technology company, said it is working with Amazon on a pipeline that does not translate code line by line but extracts pure business intent. According to the announcement, the pipeline runs through 4 stages:

  1. Extraction: AWS Transform reads the legacy applications and extracts the business logic into specifications written in EARS.
  2. Consolidation: hundreds of redundant variations of the same product are merged into lean, modern specifications.
  3. Synthesis: AI agents generate the financial products and their tests in Python.
  4. Validation: human review in which the bank's engineering and risk teams hold explicit sign-off authority.

Note the two lessons: consolidation shows that an old system carries many copies of the same rule, and the final stage is entirely human. These are the two companies' claims about their pipeline, and their example is a bank, but the method works for any company: extract, merge the duplicates, then build, and approve nothing before the decision owner signs off.

Why the process owner must confirm every rule

AI reads what the code does, not what the company wants. The gap between the two is where modernization mistakes happen:

  • Dead code: it may extract a rule from a part that has not been used for years, making it look like a live rule.
  • An old bug that became habit: the system rounds an amount the wrong way and staff fix it by hand. The extracted rule will carry the bug over unless someone says it is a bug.
  • A rule outside the code: the exception the accountant handles by hand will never appear in the extraction.
  • Conflicting rules: two versions of the discount calculation in two different places. Which one is right is a business decision, not a technical one.

So give every rule a business owner who signs it off: the sales manager for discount rules, the finance manager for late fees and approvals. Confirmed rules become the basis of the requirements brief for the new system, and we explained how to write one in our guide to writing a software requirements brief. Keep in mind that code and databases can hold customer or employee data, so any tool that reads them outside the Kingdom needs the review we covered in part 3, alongside the Saudi Data and AI Authority's guidance.

The Origami view

When we modernize an old system, we treat its business rules as the most important thing to carry over, not its code. We use AI tools to read the code and write the rules as clear sentences at a speed that was not possible before, but we do not treat a single rule as final until the process owner has read it and signed it off.

Then we test every confirmed rule against real data from the old system before we build the new one around it, so the new system calculates the way the company expects, not the way a tool guesses. If you want to see how we work, take a look at our services.

This week's exercise: one rule, three invoices

You do not need to wait for a tool to start. Pick one rule that causes frequent debate, such as a discount or a late fee, and follow these steps:

  1. Ask the process owner to write the rule in one sentence, in the form: When..., the system shall...
  2. Pull 3 real invoices from the system where the rule applied: an ordinary one, one at the limit, and one with an exception.
  3. Calculate each invoice by hand using the written sentence, and compare the result with what the system produced.
InvoiceWhat the written rule saysWhat the system didMatch?
1 - ordinary case
2 - at the limit
3 - exception

If all three match, the rule is documented. If one differs, you have found a hidden rule or an old bug, and that is exactly what you need to know before any modernization.

Coming next

You now have confirmed rules for your system. Next comes the big decision: do you move the system as it is, convert its code to a modern platform, rebuild it around the rules you extracted, or replace it with a ready-made product and keep only the data? In part 5 we compare these paths in a table: when each fits, what it keeps, what it risks, and who must be involved.

Sources

#Make the Most of Tech#How Do I Modernize My Legacy System with AI?#Legacy Modernization#Artificial Intelligence

Frequently asked questions

What are business rules in a legacy system?

They are the way your company calculates or decides things inside the system: discounts, prices, late fees, approval limits and rounding. Many are written only in the code or the database, and some live only in people's heads.

Can AI extract the rules from the code on its own?

It can read the code and write what it does as clear sentences linked to their origin, but it cannot tell which rule is an old bug or dead code, and it never sees exceptions handled by hand. That is why the process owner must confirm every rule.

What is the EARS format for writing requirements?

A way of writing every rule in a fixed order: the state, then the trigger, then what the system must do. It was first published in 2009, has 5 basic patterns, and modernization tools use it to write extracted rules in language a non-programmer can read.

How do I check that an extracted rule is correct?

Write it in one sentence, then use it to calculate 3 real invoices by hand: an ordinary one, one at the limit and one with an exception, and compare with what the system produced. Any difference means a hidden rule or an old bug to settle before modernizing.

Follow Origami in Google

Pin Origami as a preferred source and our articles will surface first for you in Google Search and Top Stories.

Add as a preferred source on Google

Related articles

How Do I Inventory My Legacy Systems Before Deciding?
Digital Transformation

How Do I Inventory My Legacy Systems Before Deciding?

Inventory your legacy systems with one page each: owner, users, data, connections, outage impact and licenses. Part 3 of the series covers what goes in the inventory, how AI speeds it up, and the five decisions for every system.

7 min read
Does My Legacy System Need Modernizing? Signs Not to Ignore
Digital Transformation

Does My Legacy System Need Modernizing? Signs Not to Ignore

Your legacy system needs modernizing if it is out of vendor support, only one person understands it, or e-invoicing still needs manual work. In part 2 of the series we cover the signs not to ignore, when it is better not to modernize yet, and an 8-point scoring exercise for each system.

7 min read
How Do I Modernize My Old System with AI? Learn from Amazon
Digital Transformation

How Do I Modernize My Old System with AI? Learn from Amazon

You can now hand a large part of modernizing your old system to AI, as long as your team reviews the result. In the first part of the series we explain how Amazon's AWS Transform works, what happened for those who tried it, what it costs, and whether it fits your business in Saudi Arabia.

7 min read
Tawakkalna Passes 30 Billion Transactions, and Your Customers Can Check Your Commercial Registration and Invoices in It
Digital Transformation

Tawakkalna Passes 30 Billion Transactions, and Your Customers Can Check Your Commercial Registration and Invoices in It

SDAIA says Tawakkalna has passed 30 billion transactions at an average of 88 million a day, and the same app lets your customers look up your commercial registration and online store and verify your e-invoice. What to check in your business this week, and SDAIA's conditions for private companies that want a service inside Tawakkalna.

6 min read
Riyadh's Digital Innovation District: What the Launch Actually Means for Your Business
Digital Transformation

Riyadh's Digital Innovation District: What the Launch Actually Means for Your Business

On August 27, 2026 the Royal Commission for Riyadh City launched a Digital Innovation District to put Riyadh among the world's top ten tech hubs. Here is what it means for your company.

8 min read
Riyadh Wants a Place Among the Top 10 Tech Hubs: What That Means for a Business That Is Not Tech
Digital Transformation

Riyadh Wants a Place Among the Top 10 Tech Hubs: What That Means for a Business That Is Not Tech

On August 27 the Royal Commission for Riyadh City announced the launch of the Riyadh Digital Innovation District, aiming to place the capital among the world's top 10 technology districts, with a focus on six named domains. The story usually reads as investment and startup news, but its nearest effect lands on companies that do not think of themselves as tech companies: contractors, factories, retailers, service firms. Those six domains are not a wish list. They are a signal about what is becoming available, and what is becoming expected.

6 min read

Have a project in mind?

We build custom systems, apps and websites for your business. Tell us your idea and we will give you a straight answer on it.

One session. Twenty minutes. No commitments.