0
votes

I am working on a Drools project which includes many many rules. We use Drools rules for validation. There are many fields and various combinations of errors. In Drools workbench 6.4.0, we use Guided Rules (with DSL) wizard to provide the business friendly UI to create rule. The problem is each new Guided Rule action will allow you to create only one rule, and it's saved as one rule file, a .rdslr file.

If I manually create the drools rules, I can simply group them together, like 10 or 20 rules, into one rule file. Using the web guided rule UI, is there a way I can add new rule to the existing guided rule file? Otherwise, I will have to create a rule file for each rule, ending up with huge number of rule files, very hard to navigate in web UI.

If I have to keep each rule in its own rule file, is there limit for the number of rule files? Is there is performance concern?

1

1 Answers

2
votes

If I manually create the drools rules, I can simply group them together, like 10 or 20 rules, into one rule file. Using the web guided rule UI, is there a way I can add new rule to the existing guided rule file? Otherwise, I will have to create a rule file for each rule, ending up with huge number of rule files, very hard to navigate in web UI.

If the when conditions are nearly the same, I suggest using the Guided Decision Table. One row is one rule.

If I have to keep each rule in its own rule file, is there limit for the number of rule files?

Practical limit, not really - thousands are easily possible with proper computer hardware (CPU, RAM).

Is there is performance concern?

With multiple rule files, no. At startup, Drools processes the rules into internally cached tables, so the end result is effectively the same regardless of the original rule format (e.g. one large rule file, all in separate rule files).

Regarding performance concern on rule organization, depends more on rule quantity. The runtime performance is still very good with lots of rules. As expected, I notice a longer build time with more rules in the system but not any execution slowness.

But rule quantity has never been the problem I've seen. Poor rules architecture is the key performance and maintenance problem, not rule quantity.