<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">you no longer need to declare custom accumulators, instead they are specified via imports. See docs, notice the “import” bit.<div><br></div><div><a href="http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/DroolsLanguageReferenceChapter.html#d0e6601">http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/DroolsLanguageReferenceChapter.html#d0e6601</a></div><div><a style="color: rgb(74, 93, 117); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 16px; text-align: justify;"><br></a></div><div><a id="d0e8437" style="color: rgb(74, 93, 117); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 16px; text-align: justify;">7.8.3.7.4.1.&nbsp;Accumulate CE (preferred syntax)</a><div><p style="text-align: justify;"><font color="#4787ff"><font face="Lucida Grande, Geneva, Verdana, Arial, sans-serif"><span style="line-height: 18px;"><b>….</b></span></font></font></p><p style="color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-weight: bold; line-height: 18px; text-align: justify;"><a id="d0e8437">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:</a></p><pre xmlns="" xmlns:d="http://docbook.org/ns/docbook" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="" style="font-size: 0.9em; font-family: courrier, monospace; background-color: rgb(245, 245, 245); color: rgb(51, 51, 51); overflow: auto; padding: 5px 15px 5px 25px; border: 1px solid rgb(204, 204, 204); font-weight: bold; line-height: 18px; text-align: justify;"><a id="d0e8437">import accumulate &lt;class_name&gt; &lt;function_name&gt;</a></pre><p style="color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-weight: bold; line-height: 18px; text-align: justify;"><a id="d0e8437">For instance, if one implements the class&nbsp;<code class="code" style="font-size: 0.9em; font-family: courrier, monospace; white-space: nowrap;">some.package.VarianceFunction</code>&nbsp;function that implements the<code class="code" style="font-size: 0.9em; font-family: courrier, monospace; white-space: nowrap;">variance</code>&nbsp;function and wants to use it in the rules, he would do the following:</a></p><div class="example" style="background-color: rgb(200, 197, 172); padding: 5px; margin-bottom: 10px; color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-weight: bold; line-height: 18px; text-align: justify;"><a id="d0e8529"><p class="title"><b>Example&nbsp;7.77.&nbsp;Example of importing and using the custom "<code class="code" style="font-size: 0.9em; font-family: courrier, monospace; white-space: nowrap;">variance</code>" accumulate function</b></p><div class="example-contents"><pre xmlns="" xmlns:d="http://docbook.org/ns/docbook" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" class="" style="font-size: 0.9em; font-family: courrier, monospace; background-color: rgb(245, 245, 245); color: rgb(51, 51, 51); overflow: auto; padding: 5px 15px 5px 25px; border: 1px solid rgb(204, 204, 204);"><span xmlns="http://www.w3.org/1999/xhtml" class="bold"><strong>import accumulate</strong></span> some.package.VarianceFunction variance

<span xmlns="http://www.w3.org/1999/xhtml" class="bold"><strong>rule</strong></span> "Calculate Variance"
<span xmlns="http://www.w3.org/1999/xhtml" class="bold"><strong>when</strong></span>
    <span xmlns="http://www.w3.org/1999/xhtml" class="bold"><strong>accumulate</strong></span>( Test( $s : score ), $v : variance( $s ) )
<span xmlns="http://www.w3.org/1999/xhtml" class="bold"><strong>then</strong></span>
    <span xmlns="http://www.w3.org/1999/xhtml" class="italic">// the variance of the test scores is $v</span>
<span xmlns="http://www.w3.org/1999/xhtml" class="bold"><strong>end</strong></span></pre></div></a></div><a id="d0e8529" style="color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-weight: bold; line-height: 18px; text-align: justify;"></a><div><br><div><div>On 5 Mar 2014, at 23:13, mattmadhavan &lt;<a href="mailto:mmadhavan@facs.org">mmadhavan@facs.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello,<br>I am still suck on Drools 5.4/5.5 since I have issues with Custom<br>operators/Evaluators in 5.6.<br><br>I am not able to move to Drools 6.x because the spring configuration is<br>screwed up. There is no option to configure Custom operator/Evaluators in<br>kie-spring.<br><br>Looks like I just cannot move to 6.x because most of my rules are highly<br>dependent on the Custom operator/evaluator I created!<br><br>I am mighty confused.<br><br>Any ideas?<br><br>Thanks<br>Matt<br><br><br><br>--<br>View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-6-x-and-Custom-Operators-Evaluators-and-Accumulators-Using-them-as-regular-functions-tp4028543p4028553.html">http://drools.46999.n3.nabble.com/Drools-6-x-and-Custom-Operators-Evaluators-and-Accumulators-Using-them-as-regular-functions-tp4028543p4028553.html</a><br>Sent from the Drools: User forum mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote></div><br></div></div></div></body></html>