It compiles without indicating an error.<br><br><div class="gmail_quote">2012/3/21 Mark Proctor <span dir="ltr"><<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div class="im">
On 21/03/2012 20:37, Wolfgang Laun wrote:
<blockquote type="cite">Yes, I was quite surprised when the DRL compilation
accepted the MVEL-ishly<br>
written function with dialect "mvel" preceding it. I thought that
there was some<br>
undocumented development. So, why does it go the way it does? <br>
</blockquote></div>
I dont' think it does. All we do is slurp in the text and pass it to
the JDT compiler. So I doubt the the code below works. i'm looking
at the JavaFunctionBuilder, I don't see any pre-processors that
would enable those inline maps to work.<span class="HOEnZb"><font color="#888888"><br>
<br>
Mark</font></span><div><div class="h5"><br>
<blockquote type="cite">
<br>
-W<br>
<br>
<div class="gmail_quote">On 21 March 2012 21:32, Mark Proctor <span dir="ltr"><<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
functions can only be written in Java.<br>
<br>
There is no support for MVEL dialect in functions.<br>
<br>
Mark<br>
On 21/03/2012 03:37, barnesjd wrote:<br>
> Correction.... I didn't paste the whole function the
second time. I do have<br>
> a return for the else...<br>
><br>
> /function int englishToInt(String englishNumber)<br>
> {<br>
> Map m = ["one":1, "two":2, "three":3, "four":4,
"five":5];<br>
> Object obj = m.get(englishNumber.toLowerCase());<br>
><br>
> if(obj != null)<br>
> return Integer.parseInt(obj.toString());<br>
> else<br>
> return -1;<br>
> }/<br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://drools.46999.n3.nabble.com/Trouble-with-the-MVEL-Map-syntax-tp3844609p3844617.html" target="_blank">http://drools.46999.n3.nabble.com/Trouble-with-the-MVEL-Map-syntax-tp3844609p3844617.html</a><br>
> Sent from the Drools: User forum mailing list archive at
Nabble.com.<br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</div></div></div>
<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>
<br></blockquote></div><br>