[rules-users] a keyword as attribute name..

Holla sachinholla at motorola.com
Mon Jan 29 02:11:56 EST 2007


unfortunately one of the facts (which is provided others) has an attribute
"duration", and rules are not getting compiled...

rule "Duration Check"
when
    ThirdPartyFact( duration > 40 )
then
    ...
end


Drools (3.0.4) documentation says:
"There are some reserved keywords that are used in the rule language. It is wise
to avoid collisions with these words when naming your domain objects,
properties, methods, functions and so on that are used in the rule text. The
following list are words that you should try and avoid in the rule contents if
possible (often times it will work fine, but in some cases the rules may be
parsed incorrectly)"

especially the last sentence is very confusing.. it does not rule out
possibility attribute names like "duration". even eclipse plugin does not report
an error!! but compiling with package builder failed saying "Unexpected token
'duration'" :(

i feel Drools should always allow attributes with name same as that of a
keyword. duration is a very common name... or at least the documentation &
plugin should strictly disallow such usage.





More information about the rules-users mailing list