[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-2419) Using an undefinied accumulate function should give a clear error warning instead of a NullPointerException
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Thu Jul 22 12:45:40 EDT 2010
[ https://jira.jboss.org/browse/JBRULES-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Edson Tirelli resolved JBRULES-2419.
------------------------------------
Resolution: Done
Fixed.
KnowledgeBuilder now properly reports a compilation error like:
Unknown accumulate function: 'nonExistingFunction' on rule 'Accumulate non existing function - Java'. All accumulate functions must be registered before building a resource. : [Accumulate: input=[Pattern: id=$st; objectType=StockTick]]
Thanks for reporting.
> Using an undefinied accumulate function should give a clear error warning instead of a NullPointerException
> -----------------------------------------------------------------------------------------------------------
>
> Key: JBRULES-2419
> URL: https://jira.jboss.org/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
> Fix For: 5.1.0
>
>
> 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 at 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/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list