[rules-dev] Better way to use And and Or

rules-dev at lists.jboss.org rules-dev at lists.jboss.org
Mon Jan 8 14:08:08 EST 2007


which is the next version. Is it aalready out?


drools - dev mailing list wrote:
> 
> 
>    Hi,
> 
>    In Drools 3.0, having the RCVRCOUNTRY and SNDRCOUNTRY as attributes 
> of the same bean, there is no better way of doing than:
> 
> when
> 
> m:   ( (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "US", AMOUNT
> >
> "3000")) ||
>  (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "UK", AMOUNT >
> "3000")) ||
>  (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "CAN", AMOUNT >
> "3000")) ||
>  (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "US", AMOUNT >
> "3000")) ||
>  (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "UK", AMOUNT >
> "3000")) ||
>  (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "CAN", AMOUNT >
> "3000")) )
> 
> then
> 
> end
> 
>    In next version you can do:
> 
> when
>   m: TransactionBean( RCVRCOUNTRY == "IRAQ" |== "IRAN", SNDRCOUNTRY == 
> "US" |== "CAN" |== "UK" )
> then
> end
> 
>    []s
>    Edson
> 
> 
> 
> rules-dev at lists.jboss.org wrote:
> 
>>Hi, 
>>I am using Drools 3.0
>>For below rule 
>>
>>RCVRCOUNTRY == IRAQ,IRAN 
>>SNDRCOUNTRY == US,CAN,UK 
>>AMOUNT > 3000 
>>i have to compile the drl with this 
>>
>>m:   (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "US", AMOUNT >
>>"3000")) 
>>m: (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "UK", AMOUNT >
>>"3000")) 
>>m: (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "CAN", AMOUNT >
>>"3000")) 
>>m: (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "US", AMOUNT >
>>"3000")) 
>>m: (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "UK", AMOUNT >
>>"3000")) 
>>m: (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "CAN", AMOUNT >
>>"3000")) 
>>
>>Is there any other easier / better way to express this as a valid DRL?
using
>>|
>>
>>  
>>
> 
> 
> -- 
>  Edson Tirelli
>  Software Engineer - JBoss Rules Core Developer
>  Office: +55 11 3124-6000
>  Mobile: +55 11 9218-4151
>  JBoss, a division of Red Hat @ www.jboss.com
> 
> 
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/Better-way-to-use-And-and-Or-tf2940808.html#a8224212
Sent from the drools - dev mailing list archive at Nabble.com.




More information about the rules-dev mailing list