The code for the function is very simple, as we could expect, as all the "dirty" integration work is done by the engine. Finally, to use the function in the rules, the author can import it using the "import accumulate" statement:
Example 7.77. Example of importing and using the custom "
variance" accumulate function
import accumulate some.package.VarianceFunction variance rule "Calculate Variance" when accumulate( Test( $s : score ), $v : variance( $s ) ) then // the variance of the test scores is $v end
I am still suck on Drools 5.4/5.5 since I have issues with Custom
operators/Evaluators in 5.6.
I am not able to move to Drools 6.x because the spring configuration is
screwed up. There is no option to configure Custom operator/Evaluators in
Looks like I just cannot move to 6.x because most of my rules are highly
dependent on the Custom operator/evaluator I created!
I am mighty confused.
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-x-and-Custom-Operators-Evaluators-and-Accumulators-Using-them-as-regular-functions-tp4028543p4028553.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
rules-users mailing list