0
votes

I am using drools in my project and assume it has 100 rules. I have two process flow (typically it has start node->rule flow task->end node). One process flow's rule flow task is specified with rule flow-group which is assigned to 50 rules and another process flow's rule flow task is specified with flow flow groups which is assigned to rest of the 50 rules. The don't overlap.

Now I use kiesession and call start process of first process flow, I see that it loads all the 100 rules instead of only 50 and gives me compilation and runtime errors. So please help me in understanding why rules from different rule flow groups are getting executed in a process flow where those rules are no where related its rule flow-group ? I see all its when conditions are getting loaded.

1
So what? All 100 are loaded, and when you come to a process flow requiring the other 50 they are already loaded. If you don't want/need that, you might split your application code, one app dealing with one process flow only, and then you could have two KieBases and two KieSessions etc.laune

1 Answers

0
votes

The "unit of work" in Drools is the KieBase and not the rule-flow-group. All the rules in your KieBase will be present in your KieSessions and will be evaluated when required.

Hope it helps,