Hi,
I have a question about the syntax of JESS 7. I’ve noticed that, in this release, there is available simplified parenthesis syntax {}, as for instance the one below:
(defrule welcome-toddlers
"Give a special greeting to young children"
(person {age < 3})
=>
((System.out) println "Hello, little one!"))
Exactly this parenthesis construct "{age < 3}" I want to use in a more complex rule.
I want to write a simplfied rule for:
(defrule Rule-KDF-BDF-Promo-1
(Input
(kontoFirma ?_kontoFirma)
(bestandFirma ?_bestandFirma)
(promotionalCode ?_promotionalCode&:
(and
(and
(or
(= ?_promotionalCode 'M')
(= ?_promotionalCode 'X')
)
(= ?_kontoFirma 5)
)
(<> ?_bestandFirma 5)
)
)
)
=>
(assert
(Output
(ruleName 'Rule-KDF-BDF-Promo-1')
)
)
)
The simplified rule should look like below:
(defrule Rule-KDF-BDF-Promo-1
(Input
{bestandFirma <> 5 && ((promotionalCode == 'M' || promotionalCode == 'X') && kontoFirma == 5)}
)
=>
(assert
(Output
(ruleName 'Rule-KDF-BDF-Promo-1')
)
)
)
But his _expression_ cannot be parsed by Jess.
Have anyone and idea about how my rule should be written with {}? Or what I'm doing wrong?
Thank you,
Cristian Negoita.
_______________________________________________________
Cristian Negoita
Otto Group
Systementwickler · Prozessteam Kunde SE-VT-KP
Otto (GmbH & Co KG) · Wandsbeker Str. 3-7 · 22172 Hamburg · Germany
Phone +49 (0) 40 64 61 1183
[EMAIL PROTECTED] · www.ottogroup.com
_______________________________________________________