[rules-users] Problem with date

Pavel Tavoda pavel.tavoda at gmail.com
Mon Mar 8 05:09:13 EST 2010


How was suggested before (in other thread) you can:
1) use getTime() method of Date class which return "long" and compare
2) use some good library for example Joda time with eval()

Pavel


2010/3/8 Bertrand Grottier <b_grottier at hotmail.com>:
> Hello,
> Ok, I understand the problem. dDeb is indeed a Date type.
> What is the proper/simplest way to achieve such a comparison ?
> Thank you in advance for your help.
> Regards,
> Benoît
>
> ________________________________
> Date: Thu, 4 Mar 2010 10:01:23 +0000
> From: ejdiggins at gmail.com
> To: rules-users at lists.jboss.org
> Subject: Re: [rules-users] Problem with date
>
> Hi,
>
> What is the type of the dDeb field? It looks like you're trying to check if
> a date is less than a string.
>
> Enda
>
> 2010/3/3 Bertrand Grottier <b_grottier at hotmail.com>
>
> Dear all,
>
> I am a newbie with Drools (Drools 5). I just want to make a date comparison
> but failed until now. Here is my drl file :
>
> package com.sample
>
> import com.sample.DroolsTest.Produit;
>
>
> rule "Prix premier semestre"
>     when
>         p1 : Produit( dDeb < "01-Jan-2010" )
>     then
>         p1.setPrix( 10 );
>         update( p1 );
> end
>
> I get a build error in Eclipse : Unable to create restriction.
>
> This must be an obvious problem but I am struggling for a while now.
>
> Any help would be appreciated.
>
> Benoit
>
> ________________________________
> Commander un cadeau en ligne discrètement? Voir la solution offerte par
> Internet Explorer8
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Enda J Diggins
>
> ________________________________
> Envie de naviguer sur Internet sans laisser de trace? La solution avec
> Internet Explorer 8
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>




More information about the rules-users mailing list