[rules-users] Date arithmetic in when part

lhorton LHorton at ABCLegal.com
Tue Jun 28 19:04:41 EDT 2011


Interesting.  I tried to use this syntax to find out if a date is older than
"now" using this source:

$p2: Person( $dob2: dob before[3d] new Date() )

but I get and exception: org.drools.RuntimeDroolsException: The 'before'
operator can only be used to compare one event to another, and never to
compare to literal constraints.

any idea how to compare to "new Date()"?  I had already written a function
to do this date comparison, but will use the Drools syntax instead if I can
get this to work.

--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-Date-arithmetic-in-when-part-tp3118246p3119793.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list