The Expert documentation has a subsection "Conditional Element accumulate" which explains about composing an accumulate operation via init, action, and result. This should work in your case. -W
On 24 April 2011 06:45, carnelk <[email protected]> wrote: > Hi, > > > I have to rule below. > This rule finds the minimal date of a 'B object' that is still AFTER the > startDate of $aObject. > I would like it to find the minimal date of B that is at least 7 days after > the startDate of $aObject > (and perhaps no more then 14 days after). > For that I would need to add some java logics instead of line <9> to > manipulate the date with java, > wouldn't I? > > Does anyone have any creative solution for that ??? > > > 1 rule "first measurement < 7 days> after the treatment" > 2 salience 9 > 3 when > 4 $aObject : A ( ) > 5 $minDate : Number() > 6 from accumulate ( B ( > 7 # I would like to change the following line to > manipulate $aObject.startDate > 8 # to be '$aObject.startDate + 7 days' > 9 date > $aObject.startDate, > 10 $bpDate : date), > 11 min($bpDate.getTime()) ) > 12 > 13 then > 14 # do something .... > 15 end > > > Much thanks, > Carmel. > > -- > View this message in context: > http://drools.46999.n3.nabble.com/How-to-add-java-logics-in-the-LHS-of-a-rule-tp2857022p2857022.html > Sent from the Drools: User forum mailing list archive at Nabble.com. > _______________________________________________ > rules-users mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users >
_______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
