On Sat, Nov 7, 2009 at 6:00 PM, Leonardo Gomes <span dir="ltr"><<a href="mailto:leonardo.f.gomes@gmail.com">leonardo.f.gomes@gmail.com</a>></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'm feeding my working memory with Maps (unfortunately, this is a<br>
requirement and I can'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["airportCode"] == "GIG"<br>
, this["numberOfPassengers"] > "1"<br>
, this["class"] memberOf ("BUSINESS", "FIRST") )<br>
<br>
And it works fine, except for dates where I get a ClassCastException,<br>
even tough I'm using the right pattern:<br>
<br>
Map ( this["departureDate"] > "07-Nov-2009" ) --- 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's no value for a given key. For example,<br>
the expression Map ( this ["name"] == 'Leonardo' ) would fail if<br>
there's no entry with "name" 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>