[rules-users] Firing a rule if at least its two conditions are satified

Moe Alkhafaji moe.alkhafaji at medcpu.com
Thu Jun 3 10:28:06 EDT 2010


I had to do something like this. The way I did it is by prividing a  
method in my object in working memory that takes multiple Boolean  
conditions and loops through them and return true if at least N of the  
conditions were true. So, this funtions will take N and a list of all  
conditions. Then it returns true or false. So, your eval will look  
like this:

eval(obj.atLeastNTrue(n, conditionA, conditionB, conditionC, etc))

Sent from my iPhone

On Jun 3, 2010, at 7:03 AM, skasab2s <skasab2s at smail.inf.fh-brs.de>  
wrote:

>
> Hello,
>
> we are using Drools in our company. We have a rule with three  
> conditions in
> this format:
>
> when
>     Condition A
>     Condition B
>     Condition C
> then
>     execute Action 1
>
> Now we have a situation, in which the rule should fire if AT LEAST  
> two of
> the three conditions are satisfied. Do you know how to implement  
> this? Any
> ideas or hints?
>
> Many thanks and regards!
>
> skasab2s.
>
>
>
>
> -- 
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Firing-a-rule-if-at-least-its-two-conditions-are-satified-tp867432p867432.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list