[rules-users] does "dialect" really have an effect?

ronalbury ronalbury at gmail.com
Mon Jan 9 13:30:12 EST 2012


Drools 5.3

Given the following rule:
rule "EasyApp Family Term Rider Max Value"
	dialect "java"
	#ruleflow-group "values-group"
	when
		$ea : EasyApp(
			getFoo1AsBoolean()==true
			&& (getFoo2AsInt() > 25000
			    || getFoo2AsInt() > getFoo3().getCurrentAmtAsInt()/5))
		) 
	then
		$ea.addError(drools.getRule().getName());
end

The method getFoo3().getCurrentAmtAsInt() returns null, and so I get a null
pointer error.  I can accept that. However, the traceback shows I am deep in
MVEL code:
Caused by: java.lang.NullPointerException
	at org.mvel2.ast.IntDiv.getReducedValueAccelerated(IntDiv.java:16)
	at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
	at
org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:43)
	at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:116)
	at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:31)
	at org.mvel2.MVELRuntime.execute(MVELRuntime.java:87)
	at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:122)
	at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:115)
	at org.mvel2.MVEL.executeExpression(MVEL.java:930)
	at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:100)
	at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
	... 17 more

I know you can use java syntax inside MVEL ... does Drools even look at the
dialect, or does it always just run everything in MVEL?

--
View this message in context: http://drools.46999.n3.nabble.com/does-dialect-really-have-an-effect-tp3645365p3645365.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list