The Expert documentation has a subsection &quot;Conditional Element accumulate&quot; which explains<br>about composing an accumulate operation via init, action, and result. This should work in your<br>case.<br>-W<br><br><div class="gmail_quote">
On 24 April 2011 06:45, carnelk <span dir="ltr">&lt;<a href="mailto:carmelk@il.ibm.com">carmelk@il.ibm.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
<br>
I have to rule below.<br>
This rule finds the minimal date of a &#39;B object&#39; that is still AFTER the<br>
startDate of $aObject.<br>
I would like it to find the minimal date of B that is at least 7 days after<br>
the startDate of $aObject<br>
(and perhaps no more then 14 days after).<br>
For that I would need to add some java logics instead of  line &lt;9&gt; to<br>
manipulate the date with java,<br>
wouldn&#39;t I?<br>
<br>
Does anyone have any creative solution for that ???<br>
<br>
<br>
1 rule &quot;first measurement &lt; 7 days&gt; after the treatment&quot;<br>
2 salience 9<br>
3 when<br>
4       $aObject :  A ( )<br>
5       $minDate : Number()<br>
6               from accumulate ( B (<br>
7                      # I would like to change the following line to<br>
manipulate $aObject.startDate<br>
8                        # to be &#39;$aObject.startDate + 7 days&#39;<br>
9                       date &gt; $aObject.startDate,<br>
10                      $bpDate : date),<br>
11                      min($bpDate.getTime()) )<br>
12<br>
13 then<br>
14    # do something ....<br>
15 end<br>
<br>
<br>
Much thanks,<br>
Carmel.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-add-java-logics-in-the-LHS-of-a-rule-tp2857022p2857022.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-add-java-logics-in-the-LHS-of-a-rule-tp2857022p2857022.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>