Hi Michael,
We are experiencing the same issue.
We have had to put our functions in a different .drl to get around
this for now. 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
rules-dev-bounces@lists.jboss.org wrote on 10/11/2009
11:52:04 PM:
> [image removed]
>
> [rules-dev] MVEL in functions?
>
> Michael Neale
>
> to:
>
> Rules Dev List
>
> 10/11/2009 11:53 PM
>
> Sent by:
>
> rules-dev-bounces@lists.jboss.org
>
> 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"
> when
> s: SimpleFact(id == 42, name == "michael")
> then
> System.out.println("hello");
> end
>
> function String doSomething() {
> return "hey";
> }
>
> And I get:
>
> java.lang.NullPointerException
> at org.drools.rule.builder.dialect.mvel.MVELDialect.compile
> (MVELDialect.java:510)
> at org.drools.rule.builder.dialect.mvel.MVELDialect.addFunction
> (MVELDialect.java:338)
> at org.drools.compiler.PackageBuilder.addFunction(PackageBuilder.java:1104)
> at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:626)
> at org.drools.compiler.PackageBuilder.addPackageFromDrl
> (PackageBuilder.java:290)
> at org.drools.compiler.PackageBuilder.addKnowledgeResource
> (PackageBuilder.java:488)
> 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: www.michaelneale.net
> blog: michaelneale.blogspot.com
> _______________________________________________
> rules-dev mailing list
> rules-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev