-
Couldn't load subscription status.
- Fork 505
Conditional Rule Execution #296
-
Hi,
I wanted to implementing a chain of three rules, where the second and third rule depends on the result of the first rule. Consider this use case:
For this, I am creating a new fact using engine.addRuntimeFact("isMinor", <true | false>) and using think fact for the next two rules. The problem is that both softDrinkSelectionRule and AlcoholicBeverageSelectionRule gets executed. I want only one rule to be evaluated on the basis of the outcome of the previous rule.
Is there a better way to implement this?
Beta Was this translation helpful? Give feedback.
All reactions
If you specify the priority of the rules so that MinorOrNotRule is a higher priority then the other rules an each rule has a high priority isMinor check then while technically both rules will run only the isMinor check would run.
See also #336 for my proposal on how the engine could more easily support this.
Replies: 1 comment
-
If you specify the priority of the rules so that MinorOrNotRule is a higher priority then the other rules an each rule has a high priority isMinor check then while technically both rules will run only the isMinor check would run.
See also #336 for my proposal on how the engine could more easily support this.
Beta Was this translation helpful? Give feedback.