Using an undefinied accumulate function should give a clear error warning instead of a
NullPointerException
-----------------------------------------------------------------------------------------------------------
Key: JBRULES-2419
URL:
https://jira.jboss.org/jira/browse/JBRULES-2419
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.0.1.FINAL
Reporter: Geoffrey De Smet
Assignee: Edson Tirelli
Priority: Minor
Reproduced on with Micheals project with Drools 5.0.1
I got this error:
{code}
Exception caught while executing action:
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@1a5e68a
java.lang.NullPointerException
at
org.drools.base.accumulators.JavaAccumulatorFunctionExecutor.createContext(JavaAccumulatorFunctionExecutor.java:82)
at org.drools.rule.Accumulate.createContext(Accumulate.java:122)
{code}
when I wrote this rule for him:
{code}
rule "rewardLowestNonFree"
when
$lowestAppsSize : Number() from accumulate(
AppServerInstance(apps.size != 0, $appsSize : apps.size),
lowest($appsSize) // Vote for
http://jira.jboss.com/jira/browse/JBRULES-1075
);
then
insertLogical(new IntConstraintOccurrence("rewardLowestNonFree",
ConstraintType.POSITIVE, - $lowestAppsSize.intValue()));
end
{code}
Turns out the "lowest" function doesn't exist. (I should have used
"min" btw)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira