[rules-users] drools date compare not working as documented

Wolfgang Laun wolfgang.laun at gmail.com
Sat May 28 03:32:28 EDT 2011


Code like this works with both versions. Can you please provide a complete
(reduced) example
producing the error?


On 27 May 2011 22:31, magaram <magaram at deltadentalmi.com> wrote:

> hi -
>
>  i am using drools-distribution-5.2.0.M2. Here is the drl i am using -
>
> ----------
> dialect "mvel"
>
> import com.deltadental.drools.sample.*
>
> rule "Rule 01"
> when
>    $underageCustomer : Customer(dob>"15-May-1993")
>    $order : Order(customerId == $underageCustomer.customerId)
>    eval($order.discountPercentage == 0)
> then
>    $order.discountPercentage = 25;
>    System.out.println("Rule 01 fired. Applied discount
> "+$order.discountPercentage);
> end
> ------------------
>
>
> I get a RuntimeDroolsException: Exception executing predicate dob >
> "15-May-1993"
> Caused by: java.lang.RuntimeException: uncomparable values <<Mon May 01
> 00:00:00 EDT 2000>> and <<15-May-1993>>
>
> caused by a class cast exception - String cannot be converted to a Date.
>
> I get the same exception with 5.1.1. I tried the same setting Locale and
> drools.dateformat properties - no luck so far..
>
>  Am I missing something here?
>
> Thanks
> Muk
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/drools-date-compare-not-working-as-documented-tp2994330p2994330.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110528/eae650e1/attachment.html 


More information about the rules-users mailing list