On Sat, Nov 7, 2009 at 6:00 PM, Leonardo Gomes <span dir="ltr">&lt;<a href="mailto:leonardo.f.gomes@gmail.com">leonardo.f.gomes@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I&#39;m feeding my working memory with Maps (unfortunately, this is a<br>
requirement and I can&#39;t use beans).<br>
<br></blockquote><div><br>Before people start racking their brains to overcome all the resulting difficulties: Could you please explain what this requirement is meant to achieve?<br>-W<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

To access the values in this maps I use the following MVEL expression :<br>
<br>
                Map ( this[&quot;airportCode&quot;] == &quot;GIG&quot;<br>
                        , this[&quot;numberOfPassengers&quot;] &gt; &quot;1&quot;<br>
                        , this[&quot;class&quot;] memberOf (&quot;BUSINESS&quot;, &quot;FIRST&quot;) )<br>
<br>
And it works fine, except for dates where I get a ClassCastException,<br>
even tough I&#39;m using the right pattern:<br>
<br>
Map ( this[&quot;departureDate&quot;] &gt; &quot;07-Nov-2009&quot; )   --- fails<br>
<br>
Is there anything I need to do to make the dynamic cast of dates work,<br>
in this particular case?<br>
<br>
--<br>
<br>
Morever, I get NPEs if there&#39;s no value for a given key. For example,<br>
the expression Map ( this [&quot;name&quot;] == &#39;Leonardo&#39; ) would fail if<br>
there&#39;s no entry with &quot;name&quot; as the key.<br>
<br>
Any help is welcome!<br>
<br>
Thanks in advance,<br>
Leo.<br>
_______________________________________________<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>