<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
As MVEL functions can't be called directly from java, this doesn't work
yet.<br>
<br>
I did get MVEL functions to work from the drools-clips module, so there
is some plumbing for this. We'd probably have to generate stab wrappers
to get MVEL functions working in DRL itsef, so both java and mvel
semantics can call it.<br>
<br>
Mark<br>
Michael Neale wrote:
<blockquote
 cite="mid:96ab3ced0910121549i31af52cbjed5a680a22813565@mail.gmail.com"
 type="cite">
  <pre wrap="">OK created this: <a class="moz-txt-link-freetext" href="https://jira.jboss.org/jira/browse/JBRULES-2298">https://jira.jboss.org/jira/browse/JBRULES-2298</a>

On Tue, Oct 13, 2009 at 9:38 AM, Michael Neale <a class="moz-txt-link-rfc2396E" href="mailto:michael.neale@gmail.com">&lt;michael.neale@gmail.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Steve - yes that seems to work - hence why I have not noticed it
before. I wonder with 4.0.x if it was actually using MVEL for the
function body, or flipping back to the java dialect (which is what
happens when you put it in a different DRL now).

On Tue, Oct 13, 2009 at 1:24 AM, Steve Ronderos <a class="moz-txt-link-rfc2396E" href="mailto:steve.ronderos@ni.com">&lt;steve.ronderos@ni.com&gt;</a> wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi Michael,

We are experiencing the same issue. &nbsp;We have had to put our functions in a
different .drl to get around this for now. &nbsp;If it helps any, this was
working ok in version 4.0.7, and broke when we went to 5.0.1.

Thanks,

Steve Ronderos

<a class="moz-txt-link-abbreviated" href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</a> wrote on 10/11/2009 11:52:04 PM:

      </pre>
      <blockquote type="cite">
        <pre wrap="">[image removed]

[rules-dev] MVEL in functions?

Michael Neale

to:

Rules Dev List

10/11/2009 11:53 PM

Sent by:

<a class="moz-txt-link-abbreviated" href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</a>

Please respond to Rules Dev List

Hey is mvel in functions broken? I have a distant memory of something
along these lines. I was just trying something like:

package jboss.cloud

dialect "mvel"


#trying to get functions working...
rule "something"
&nbsp; &nbsp; when
&nbsp; &nbsp; &nbsp; &nbsp; s: SimpleFact(id == 42, name == "michael")
&nbsp; &nbsp; then
&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("hello");
end

function String doSomething() {
&nbsp;return "hey";
}

And I get:

java.lang.NullPointerException
&nbsp; &nbsp;at org.drools.rule.builder.dialect.mvel.MVELDialect.compile
(MVELDialect.java:510)
&nbsp; &nbsp;at org.drools.rule.builder.dialect.mvel.MVELDialect.addFunction
(MVELDialect.java:338)
&nbsp; &nbsp;at
org.drools.compiler.PackageBuilder.addFunction(PackageBuilder.java:1104)
&nbsp; &nbsp;at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:626)
&nbsp; &nbsp;at org.drools.compiler.PackageBuilder.addPackageFromDrl
(PackageBuilder.java:290)
&nbsp; &nbsp;at org.drools.compiler.PackageBuilder.addKnowledgeResource
(PackageBuilder.java:488)
&nbsp; &nbsp;at org.drools.builder.impl.KnowledgeBuilderImpl.add
(KnowledgeBuilderImpl.java:25)

(haven't tried trunk) - anyone else seen this?
removing the dialect "mvel" at the package level at it is fine.





--
Michael D Neale
home: <a class="moz-txt-link-abbreviated" href="http://www.michaelneale.net">www.michaelneale.net</a>
blog: michaelneale.blogspot.com
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
        </pre>
      </blockquote>
      <pre wrap="">_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>


      </pre>
    </blockquote>
    <pre wrap="">

--
Michael D Neale
home: <a class="moz-txt-link-abbreviated" href="http://www.michaelneale.net">www.michaelneale.net</a>
blog: michaelneale.blogspot.com

    </pre>
  </blockquote>
  <pre wrap=""><!---->


  </pre>
</blockquote>
<br>
</body>
</html>