With 4.0.0 i am getting the run time exception on functions. what could be the problem
Exception
java.lang.NullPointerException
at org.drools.base.ClassTypeResolver.resolveType(
ClassTypeResolver.java:127)
at org.drools.rule.builder.dialect.java.JavaFunctionBuilder.build(JavaFunctionBuilder.java:72)
at org.drools.rule.builder.dialect.java.JavaDialect.addFunction
(JavaDialect.java:434)
at org.drools.compiler.PackageBuilder.addFunction(PackageBuilder.java:350
)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:259)
at org.drools.compiler.PackageBuilder.addPackageFromDrl
(PackageBuilder.java:147)
at com.drools.sample.ParseDRL.readRuleFromDrl(ParseDRL.java:86
)
at com.drools.sample.ParseDRL.main(ParseDRL.java:25)
Exception in thread "main"
My Function:
function
double getROI(loanAmount){
double roI=0.0;
if( loanAmount <= 499000 )
roI = 18;
else if( loanAmount <= 999000 )
roI = 17;
else if( loanAmount <= 1990000 )
roI = 14.5
;
else if( loanAmount <= 3990000 )
roI = 12;
else if( loanAmount <= 7490000 )
roI = 11.5
;
else if( loanAmount > 7490000 )
roI = 9.99
;
return roI;
}
Thanks
Natraj Gudla