j-easy / easy-rules

The simple, stupid rules engine for Java
https://github.com/j-easy/easy-rules/wiki
MIT License
4.86k stars 1.05k forks source link

Composite rule group with different set of facts for each rule #340

Open rahamathulla-ai opened 3 years ago

rahamathulla-ai commented 3 years ago

I have a requirement to execute composite rule in a manner that

each rule have a set of facts. The engine should execute each rule with its associated facts and find out the whole rule.

I think the UnitRuleGroup is an implementation of AND like condition. is there any rule implementation available for OR condition.

Please suggest

zhhaojie commented 3 years ago

ActivationRuleGroup can do it well

daidai21 commented 3 years ago

ActivationRuleGroup is XOR logic, not OR logic.

https://github.com/j-easy/easy-rules/blob/ab75210854e06dff39469bd0a42b8c45ebf826ed/easy-rules-support/src/main/java/org/jeasy/rules/support/composite/ActivationRuleGroup.java#L32-L33