DecisionTable Execution Engines - Meeting the Need for Speed
Published by Rajgo September 22nd, 2006 in Business Rules, BRMS, Rule Engine, QuickRules.NET, BRE, Decision TablesDecisionTables are a totally cool device for capturing Rules. They are used to capture structurally similar rules in a tabular format.
Most Business Rules Vendors implement DecisionTables somewhat like this.
- Each row in a Decision Table represents a Rule
- The Decision Table is de-constructed into as many If Then Rules as there are rows.
- These rules are merged into the Network (assuming a Rete Engine) of Rules
So what is wrong here?
Nothing, if your tables only have a small number of rows.
Number of evaluations in a table with N rows and M conditions is N*M.. Even for a table with 500 rows & 3 conditions, this is equivalent to a Rete Ruleset with 500 Rules with 3 conditions each. Whew!!
But when you would like to have Decision Tables with even a slightly large number of rows, this structure becomes a botleneck and the performance drops drastically.
QuickRules.NET adopts a different approach. It provides a separate Decision Table execution Engine that evaluates the table far more quickly.
This is how it works in case of a “Find First match”:
- Walk down the first column until you hit a match for that column.
- Then start walking right on those rows where column 1 matched(Row Span in this case).
- Repeat for rest of the columns
- If Match Fails in one of the columns in a row, then the default behavior is to Go to the next row, and start over.
- If necessary, you can also exit by Step 3.
We had this customer recently, who was programatically creating his Decision Tables by loading the rows from a CSV file with 2000 rows. This Decision table implementation clearly scales for large tables, and is best if you need to import your rules from XLS without needing to impose any table sizes.
Now, a Decision Table can also return multiple matches. Lets take for example, a scenario where you want to find all the possible Product Recommendations for an applicant. Now, all these recommendations can come from a Decision Tables that contains all possible matches. Here, it would be easier if the Decision Table itself returns all the possible matches. If this were not the case, your rules will become more complex than they need to be.



















No Responses to “DecisionTable Execution Engines - Meeting the Need for Speed”
Please Wait
Leave a Reply