Regis,
If Grade.A and Grade.B are object types, try this:
...
when
customer: Customer( code == "J", gr : grade -> ( gr.equals(Grade.A)
|| gr.equals(Grade.B) )
then
...
If Grade.A and Grade.B are primitive types:
...
when
customer: Customer( code == "J", gr : grade -> ( ( gr == Grade.A )
|| ( gr == Grade.B ) )
then
...
Hope it helps.
Edson
Régis LOWE wrote:
Hi,
can someone explain me how to write the following condition :
(Customer(grade==Grade.A) or Customer(grade==Grade.B)) and
Customer(code=="J")
the following snippet produces :
unknown:52:66 Unexpected token ')'
Unable to resolve ObjectType '('
rule "discount10"
no-loop true
when
#conditions
customer: (Customer(grade==Grade.A) or Customer(grade==Grade.B)) and
Customer(code=="J")
eval (customer.getTotal()>100000)
then
#actions
end
---------------------------------
Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos
services préférés : vérifiez vos nouveaux mails, lancez vos recherches et
suivez l'actualité en temps réel. Cliquez ici.