[rules-users] issue with date comparison

sumatheja sumatheja at gmail.com
Thu Jun 21 07:10:23 EDT 2012


Hi,
   I've a fact which is retrieved from database using hibernate. The date
format that comes in is "yyyy-mm-dd", java.util.Date. The fact has two
variables *startDate* and *endDate. *I want to check if the the *current
date* lies between these two. Since the current date is not constant I'm
trying to use a global variable, which I would setbefore firing the rules.
My question is what should be the datatype of this global variable. If I
use Date the format is completely different. If I use String it says that
date can't be compared with string.

    However if I hard code the value of current date in "*dd-MMM-yyyy*"
rule fire fine. Can someone please suggest me a way to achieve this. Thanks
in advance.

-- 
cheers
Sumatheja Dasararaju
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120621/084bff87/attachment.html 


More information about the rules-users mailing list