you have the start and end date, you can filter with that information?<br>CrewSegment( personId == $s.personId, $crewHours : crewHours, startDate <= "<date>", endDate => "<date>" ),<br>
<br>Greetings.<br><div class="gmail_quote">On Thu, May 6, 2010 at 4:24 PM, <span dir="ltr"><<a href="mailto:billhainaut@gmail.com">billhainaut@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Drools Experts:<br><br>I have a list of the following fact objects sent to my rules:<br><br>CrewSegment<br> Date startDate<br> Date endDate<br> double crewHours<br> int personId<br><br>along with an object to designate seats:<br>
<br>SeatAssignment<br> int seatId<br> int personId<br><br>Here is the rule I want to enforce in English: No crew member (uniquely identified by personId) can have more than 56 hours of total crewHours in any 7 day period. The rule I've written so far is:<br>
<br>when<br> $s : SeatAssignment ( )<br> $total : Number( doubleValue > 56 ) <br> from accumulate( CrewSegment( personId == $s.personId, $crewHours : crewHours ),<br> sum( $crewHours ) )<br>
<br>This rule nicely catches any instance where more than 56 hours are committed by a person, but does not limit the time period to 7 days.<br><br>How do I limit the search to be sure that it is 56 hours WITHIN 7 days, and not just 56 hours total over ANY time period?<br>
<br>Thanks in advance for any help you can provide!!!<br><br>Bill<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> - <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br> - <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> - Salatino "Salaboy" Mauricio -<br>