Bug 998930

Summary: Not possible to register custom accumulate functions
Product: [Retired] JBoss BRMS Platform 6 Reporter: Jiri Locker <jlocker>
Component: Business CentralAssignee: manstis
Status: CLOSED WONTFIX QA Contact: Jiri Locker <jlocker>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0.0CC: etirelli, lpetrovi, rrajasek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Feature: Add support for custom accumulate functions in Drools Workbench. Reason: Result (if any):
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-09 14:49:34 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Locker 2013-08-20 11:08:51 UTC
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:
drools.accumulate.function.mysum=org.jboss.qa.brms.accumulate.DoubleSum

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):
ER1

How reproducible:
-

Steps to Reproduce:
1.
2.
3.

Actual results:
Doesn't work.

Expected results:
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?).

Additional info:

Comment 1 manstis 2013-08-21 14:15:52 UTC
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.

Comment 2 Edson Tirelli 2013-10-01 00:36:33 UTC
Setting priority to low as this is a nice to have feature, but the focus atm is on fixing bugs.