It seems not work.<br>When I try <br><i>$msg : Message($date : date)<br><b>Order </b>( $date &gt; &quot;Mar-01-2012&quot; )</i><br>I meet error &quot;Unable to create Field Extractor for &#39;$date&#39; of &#39;[ClassObjectType class=org.drools.examples.HelloWorldExample$Second]&#39; in rule &#39;default&#39; : [Rule name=default, agendaGroup=MAIN, salience=0, no-loop=false]&quot;<br>
<br>When I try<br><i>$msg : Message($date : date)<br><b>eval </b>( $date &gt; &quot;Mar-01-2012&quot; )</i><br>If the dialect is &quot;java&quot;, I meet error &quot;Rule Compilation error : [Rule name=default, agendaGroup=MAIN, salience=0, no-loop=false]<br>
    org/drools/examples/test/Rule_default_0.java (8:354) : The operator &gt; is undefined for the argument type(s) Date, String&quot;<br>If the dialect is &quot;mvel&quot;, I meet the same ClassCastException.<br><br><div class="gmail_quote">
On 29 March 2012 22:28, FrankVhh <span dir="ltr">&lt;<a href="mailto:frank.vanhoenshoven@agserv.eu">frank.vanhoenshoven@agserv.eu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This may sound a bit rude, but... why would you want to do such a thing?<br>
<br>
If there is a constraint on the message, then why not put that constraint in<br>
the message structure?<br>
<br>
Btw, I think it would work by using eval($date &lt; &quot;...&quot;) but see no use for<br>
it either.<br>
<br>
<br>
Joe Zendle wrote<br>
&gt;<br>
&gt; did you try:<br>
&gt;<br>
&gt;  *$msg : Message($date : date)<br>
&gt; Order ( $date &gt; &quot;Mar-01-2012&quot; )*<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2012/3/29 Zeke &amp;lt;xanadu860122@&amp;gt;<br>
<div class="im">&gt;<br>
&gt;&gt; Hi, guys:<br>
&gt;&gt;   I meet a strange issue and need your help again... I am using Drools<br>
&gt;&gt; 4.0.7.<br>
</div>&gt;&gt;   When my rule condition is as *Message( date &gt; &quot;Mar-01-2012&quot; )*,<br>
<div class="im">&gt;&gt; everything is OK. But if I change it to be as below:<br>
</div>&gt;&gt;   *$msg : Message()<br>
&gt;&gt;   Order ( $msg.date &gt; &quot;Mar-01-2012&quot; )*<br>
<div class="im">&gt;&gt;   I will meet &quot;java.lang.String cannot be cast to java.util.Date&quot;<br>
&gt;&gt; ClassCastException. &quot;Order&quot; is another fact. I attach the exception call<br>
&gt;&gt; stack. Please check it. It looks like a bug to me. Do we fix it in later<br>
&gt;&gt; release? If so, can you tell me which release contains the fix? Thanks!<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
</div>&gt;&gt; rules-users@.jboss<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; rules-users@.jboss<br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rules-users-ClassCastException-when-comparing-date-type-with-literal-tp3867229p3867832.html" target="_blank">http://drools.46999.n3.nabble.com/rules-users-ClassCastException-when-comparing-date-type-with-literal-tp3867229p3867832.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br>