(These are notes from an implementation in DROOLS, but with points of general interest.)

This ruleflow framework – a tree structure – is not exclusive to DROOLS: some high-end packages use similar graphical interfaces to structure the rules and processes:

The decision-trees of XpertRule are more sophisticated, but worth reviewing to see how much can be done.

Cincom’s GURU has the additional sophistication of modeling Bill Of Materials using the structure.  DROOLS does not allow objects to be inserted dynamically into the tree like GURU, but the DROOLS ruleflow could be used to emulate the most common (fixed-tree) type of BOM, and other node based assembly structures.

Also, while we only generalized pattern rules, you may find it worthwhile even using this framework for rules where the rule is not reused anywhere, because the method still gives non-technical users direct access to the rules.

Where a pattern rule contains multiple sub-rules, you can consider making these rules “parameter driven” with a simple boolean in the LHS.  This gives the non-technical user the ability to turn parts of the rule off/on at will, without touching complex code.

A further pattern develops over time, and that is the preamble/postamble rules: in many system eventually the need for wrappers for every rule is realized, to initialize objects before the rule is fired (audit, initialization, security, statistics), and after it has fired too.  Again these can be realized in the ruleflow, and below is an extract from a large ruleflow, showing the general sequence:

rf

.