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