[rules-users] Oring conditions

Mark Proctor mproctor at codehaus.org
Sun Nov 30 23:30:34 EST 2008


Waleed Zedan wrote:
> Hi ,
>
> Thanks for your quick reply,
>
> the problem that these conditions are on different objects for example
>
> Person(name == "xyz") &&
> (Cheese(type == "zzz") OR
>  Address(street == "1") OR
>  Phone (number == "xyz") )
Bind each pattern, and do the || field constraints in an eval.

Mark
>
> Thanks again.
>
> Best Regards,
>
> Waleed Zedan
>
> On Sun, Nov 30, 2008 at 7:03 PM, Edson Tirelli <tirelli at post.com 
> <mailto:tirelli at post.com>> wrote:
>
>      
>        Are conditions 2-4 applied to the same pattern type? If so, you
>     can use the "||" Field Constraint Connective instead of the "or"
>     Conditional Element:
>
>     when
>         Person( name  == "Bob" )
>         Cheese( type == "brie" || size > 2 || price <= 30 )
>     then
>        ...
>     end
>
>         These conditions will not generate new rules as the OR CE does...
>
>         []s
>         Edson
>
>
>     2008/11/30 Waleed Zedan <wzedan at gmail.com <mailto:wzedan at gmail.com>>
>
>         Hi All,
>
>         I have this requirment : Rule A -> Condition 1 AND
>                                                         (Condition 2 OR
>                                                          Condition 3 OR
>                                                          Condition 4)
>         The problem is that OR (||) operators in drools are not a
>         short circuiting operators like in Java.
>
>         May you please tell me an approach to handle this situation ,
>         i have already tried splitting it on multiple rules ,but i am
>         searching for better approach.
>
>         I am using Drools 4.0.7. <http://4.0.7.>
>
>         Thanks.
>
>         Best Regards,
>
>         -- 
>         Waleed Zedan
>
>
>
>         _______________________________________________
>         rules-users mailing list
>         rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>         https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>     -- 
>      Edson Tirelli
>      JBoss Drools Core Development
>      JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
>
>     _______________________________________________
>     rules-users mailing list
>     rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> -- 
> Waleed Zedan
> Senior Software Developer
> IT Design & Development Department
> Dubai Customs
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20081201/d2fed779/attachment.html 


More information about the rules-users mailing list