Fog Creek Software
Discussion Board

Rules-based decision making

I am working on a project that might be suitable for a "rules-based" approach. (Disclaimer: I am asking this question because I know nothing about the subject.)

The system will have a fairly straightforward "cases" and "case members" structure (in the governmental human services arena). One of our goals is to have the system determine what the "next appropriate action(s)" are for each case. Some examples: send a letter to the client, cut a check, or prompt a worker to take manual action. More than one action may be appropriate depending on the situation.

There will be a ton of rules and they will probably change fairly frequently. I need to investigate the possibility of building or buying a "rules engine", with the goals of making this system easy to maintain and augment while still performing well (there are a lot of cases).

Does anyone have experience in this arena? I'm interested in knowing how rules are typically defined, stored, and implemented, as well as what the appropriate trigger would be (for instance, does every single transaction trigger a review of the case to determine the next appropriate action?) I'm being intentionally vague about the environment for the moment, as I want to start at a conceptual level to see what's out there. Thanks!

Friday, January 09, 2004

I can't say anything about production systems, but a good decade or more ago I used PROLOG for a large project in my university days that worked great for this type of application. There are a number of vendors (do a quick google search) who offer PROLOG compilers -- including GNU if you're into the whole open source "free" thing.  It certainly makes things far easier than rolling your own.

In a nutshell, it's basically a database of "rules" and/or "facts" that you define, and a language wrapped around the rules engine.

It takes a while to understand the "right" way to use it if you've never done this type of programming before, but once it all clicks together inside your head, it makes some rather difficult programming actually quite simple.

I imagine the difficulty you'd have is interfacing the rest of your application with the PROLOG generated programs -- I don't know how to do that as the only experience I have with it was a dozen years ago and things were much different then.

OTOH -- you can look at any number of "state machine" type packages that would also work. You define your states, and the allowable paths between those states.

You definitely don't want to try to "roll your own" on this unless you've got (a) a large budget, (b) a lot of time or (c) both.

Sgt. Sausage
Friday, January 09, 2004

The other typical approach is based on OPS5-like production systems.  These allow you to develop a network of rules and facts, from which other facts (like what to do next) are derived.  Some of the better engines support variations like conditionally asserting facts or goal seeking.

The most common implementation of this kind of system is based on the Rete algorithm developed by Charles Forgy.  This algorithm basically creates a big network out of the rules and then incrementally updates the state of the network nodes based on the stream of facts which are entered into the system.  This makes the deduction process extremely fast, relative to other approaches, at the cost of space.

The best product I've ever used in this category is the Eclipse engine, by Haley enterprises (, a pioneer in this field.  They also have other products built on top of their Engine which you may find it useful to examine, especially Authorete.

In addition to Eclipse, there is a Java based platform from Sandia Labs, called JESS (  The author of this package has also produced a marvelous book on rule based programming (

There's also a package called CLIPS that was developed by NASA that's really good.  It combines the rule system with an object oriented programming system (  This one also has an excellent book associated with it (

Another one (that I haven't used) is by the inventor of the RETE algorithm, called OPS-J.  This one actually embeds the rules directly into Java objects.  (

Finally there are other commercial offerings, but none that I've used as good as the product from Haley Enterprises.  Google should help you uncover these easily.

uncle rete
Friday, January 09, 2004

I should mention that the OPS-J product apparently uses a next generation version of RETE called (you guessed it) RETE-II, purportedly faster and better than the original in some cases. It is also embedded in several systems, not just Java.

uncle rete
Friday, January 09, 2004


The product basically allows you set define a set of rules using a rule builder and automatically generates screens for the purposes of taking the client/customer through an interview process to determine the facts of the case (only asking the questions necessary to determine a conclusion). 

Most applications so far have consisted of modelling legislation, normally in the area of determining entitlements for people, but it can pretty much be used anywhere where rules-based decisions are required.

It's a pretty good system, email me if you want more info.

(Disclaimer: I am a SoftLaw employee, so I'm a bit biased)

Friday, January 09, 2004

Here's a list of open source rules engines written in Java (might be useful):

Walter Rumsby
Friday, January 09, 2004

To build a system such as that described you will certainly need to model and document the business processes that are to be embedded in it. You will also, I expect, find that existing processes need clarification and enhancement, and that the whole lot will evolve over time, particularly if you are engaged in any type of TQM process where there is a lot of feedback.

May I suggest that you look for a good tool to help you.


Promanade from


I have no financial interest in the company, but I work as a part-time, voluntary business mentor for the local enterprise organisation and Mandos is one of my mentorees.

David Roper
Saturday, January 10, 2004

There is a list of open source java rule engines at

Rich Fuchs
Sunday, January 11, 2004 has KRules a java rules engine, which you could look at for your requirement

Joe Corfield
Saturday, January 31, 2004

I would suggest you to take a look at case based system also. Try Consult from Tata Consultancy Services. (

Wednesday, February 04, 2004

*  Recent Topics

*  Fog Creek Home