<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 21/03/2012 20:37, Wolfgang Laun wrote:
<blockquote
cite="mid:CANaj1LcE3PY5F8D=+Y4rKKYtgU5RsHPaevhAqrKZ_gfGbZkOng@mail.gmail.com"
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>
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.<br>
<br>
Mark<br>
<blockquote
cite="mid:CANaj1LcE3PY5F8D=+Y4rKKYtgU5RsHPaevhAqrKZ_gfGbZkOng@mail.gmail.com"
type="cite">
<br>
-W<br>
<br>
<div class="gmail_quote">On 21 March 2012 21:32, Mark Proctor <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:mproctor@codehaus.org">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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
> <a moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
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 class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>