Fog Creek Software
Discussion Board

Rules Engine? Expert System?

What is the difference between a rules engine and an expert system?

I have been looking into how to manage some complex sets of financial rules centered on sales and promotions of goods. I would like to be able to have the sales managers build the rules for a sale with a non-technical interface, they need to be able to say things like "if a wholesale customer buys 300 feet of aps paper they can get another 300 feet at 20% off" and then have the application make the sales people aware of the offer if their order is close to getting the discount or just apply the savings as a line item if they meet the criteria. The sales change so often that it would be very costly to just add hard coded logic to the application.

I have been looking into things like ruleML and Mandrax and they look like a good start into how to save the logic and be able to pull it into the application. Where I am having some problems is in understanding if this is the right path to solve the problem I am facing. What types of options are out there?

If anyone recommend some good reading material on the subject it would be greatly appreciated?


Monday, June 2, 2003

Business rules.. Check out this.

Sounds like what you need and theres even a flash intro and free demo download.

Kent Design4Effect
Monday, June 2, 2003

Do you really need for them to be able to define *any* rule?

Examine the requirements in more detail, and you might find that all of the rules boil down to some small set of N patterns, like:

* quantity pricing levels

* cross-promotions

* package deals

* timed offers

These sorts of things are usually highly structured, and quite implementable with a few database tables.  Expert systems are intended for much more complex things than this, that require considering multiple alternatives or finding connections between items.  You'll probably waste a lot of time and/or money going the expert system route.  What's more, a form-driven UI based on choosing a promotion type and filling in the blanks is straightforward to create *and* use.  Commercial expert systems often have their own fancy "builder" tools to help turn the fancy expert system *back* into a simple form or table-driven UI!

Ideally, I would design the sales system so that there is some type of "promotion interface" for promotion components that can be invoked by the sales process, such that I could implement arbitrarily many promotion components.  I'd set up the system with a handful of promotion types to cover the 80% of common cases, then find out what items fall through the cracks.  I might include a "scriptable promotion" type that let me put in some simple expression code (e.g. in Python or another interpreted language) to perform the necessary calculations.  Then, if a promotion came up that couldn't be handled with the simple types, I could whip up a temporary fix with the scriptable component.

Phillip J. Eby
Monday, June 2, 2003


Thanks for the advice.

Rules engines seem like such an interesting idea. This might explain why I latched onto it instead of staying with traditional application logic to solve the problem that was proposed.

I am wondering where would I go to learn more about when such a system is appropriate, the pitfalls of them, the benefits etc? So far my googleing has only brought me to educational thesis on the subject or product pages that promise it will solve all my problems and those of the company next to mine.

Thanks again.

Monday, June 2, 2003

> What is the difference between a rules engine and an
> expert system?

AFAIK, 'a rules engine' aka 'rule based expert system' is a subtype of the expert system

Tuesday, June 3, 2003

*  Recent Topics

*  Fog Creek Home