Red Hat Bugzilla – Bug 998930
Not possible to register custom accumulate functions
Last modified: 2015-12-09 09:49:34 EST
Description of problem:
I want to use a custom accumulate function in a rule like this:
Number( intValue >= 100 ) from accumulate ( p : Person( sex == "M" ), mysum(p.age))
I have commited a properties file registering my implementation of accumulate function like this:
Despite of that, when I validate the rule, I'm getting an error:
Unknown accumulate function: 'mysum' on rule 'my rule'. All accumulate functions must be registered before building a resource.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Should be possible to register a custom accumulate function. Either using a properties file as it used to work in BRMS 5.x, or using some other project-level configuration file, ideally through Workbench UI (Project Editor perhaps?).
Drools Workbench (aka Guvnor) has never had explicit support for custom accumulate functions; that said, I've never tried with 5.x. Can you confirm custom accumulate functions work outside of the web application, i.e. plain DRL.
Setting priority to low as this is a nice to have feature, but the focus atm is on fixing bugs.