Thanks for the response. I will follow that.<br><br><div class="gmail_quote">On Wed, May 9, 2012 at 11:38 AM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Don't do this: LHS code should not have any side effects and should<br>
not depend on the time a CE or constraint is evaluated.<br>
<br>
If your variable should represent a yyy-mm-dd 0:00:00, you should<br>
establish a global variable of type Date and initialize it after<br>
creating your session and before inserting any facts.<br>
<br>
-W<br>
<div class="im"><br>
<br>
On 09/05/2012, sumatheja <<a href="mailto:sumatheja@gmail.com">sumatheja@gmail.com</a>> wrote:<br>
> Hi All,<br>
> Can anyone tell me if there is a variable or standard way to get<br>
</div>> the *current date* and compare with the java.util.Date. I'm trying write<br>
<div class="im">> the below rule but it doesn't work. It doesn't throw any error but the rule<br>
> is not at all fired in any case<br>
><br>
> rule "new rule"<br>
> dialect "java"<br>
> when<br>
</div>> Message(*testDate < new Date()*)<br>
<div class="im">> then<br>
> System.out.println("Test");<br>
> end<br>
> Do I have to insert a seperate fact which will contain the current date?<br>
> Thanks in advance.<br>
><br>
> --<br>
> cheers<br>
> Sumatheja Dasararaju<br>
><br>
</div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>cheers<br>Sumatheja Dasararaju<br><br><br>