<br>&nbsp;&nbsp;&nbsp; Yury,<br><br>&nbsp;&nbsp;&nbsp; Correlation can happen in many ways, but I would say your general approach is correct. Answering your questions:<br><br>1. Both collect and accumulate work (as it is today) on single patterns. This means whenever you are using collect, you could be using accumulate. Just have in mind that accumulate is more powerful and flexible that collect, but it is also heavier. So, if collect does what you need, go with collect, otherwise fall back to accumulate.
<br><br>3. Collect is incremental (on 4.0 GA) for all working memory operations: insert/update/retract. Accumulate is always incremental for insert, but for modify and retract it is incremental only if you provide the &quot;reverse&quot; action in case you are using adhoc operations. If you are using accumulate functions, modify and retract are incremental if the function supports reverse calculation.
<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/8/1, Yuri de Wit &lt;<a href="mailto:ydewit@gmail.com">ydewit@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am finally having some time to use collects. What I basically need<br>to do is to collect items from a list using a specific criteria, then<br>collect items from a diff list using another criteria, and finally<br>compare the groups collected using a 3rd criteria
<br><br>Here is what I am thinking:<br><br>i : Item(type==A)<br>ig : ItemGroup(size&gt;1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collect Item(a==i.a, b==i.b, ... n==i.n)<br><br>i2: Item(type==B)<br>ig2 : ItemGroup( size&gt;1,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ga==
<a href="http://ig.ga">ig.ga</a>, gb==<a href="http://i.gb">i.gb</a>, .... )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collect Item(a==i.a, b==i.b, ... n==i.n)<br><br>1) It is quite nice that any implementation of java.util.Collection<br>can be the resut of collect. ItemGroup here not only keeps hold of all
<br>Items returned but has some aggregate properties (afaik, I cannot use<br>the aggregate functions with accumulate since I have multiple column<br>aggregation).<br><br>2) Am I on the right track? Or is there a better way?
<br><br>3) Is the collect recomputed from scratch or incrementally every time<br>a new fact is asserted or updated?<br><br>thanks<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli
<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>