I've few drools rules that I want to use in different rule flows. Since, Drools rule supports only one ruleflow-group name at a time and rule flow business rule task also can be mapped with single ruleflow-group, I'm not able to use same rule in different rule flows. Is there any other way that I can use to filter the rules? like using tags or and metadata?
Asked
Active
Viewed 240 times
1 Answers
0
You could create your own rule groups. You create a class OwnRuleGroup with String group in it as a field. Then when you fire rules you create an instance of your own rule grup:
OwnRuleGroup myGroup = new OwnRuleGroup();
myGroup.group = "foo";
and insert it into session with other facts. In every rule you could specify which of the groups you want to fire.
rule "This will fire for groups foo,bar"
when
OwnRuleGroup(group in ["foo", "bar"])

Master Drools
- 728
- 6
- 18