Matthew Shaw's message received 5/29/2007 9:39 PM:
ok point taken. I have modified my rule so that it looks at an object
and I modify a property on that object instead as follows: But still the
same issue.
* *
*rule* "sum higher rate totals"
*salience* 970
*no-loop* *true*
*when*
timesheet : TimesheetTransferObject( )
total : SheetTotalTransferObject($ihrisType : ihrisType ->
($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate ->
($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) ==
*false*))
*eval*(total.getValue().doubleValue() > 0)
higherDutyTotal : DutyHourTotal( )
*then*
higherDutyTotal.setNrHours(DateUtils.addElapsedTimes(higherDutyTotal.getNrHours(),
total.getValue().doubleValue()));
*modify*(higherDutyTotal);
This modify call tells the rule engine to "look at
this DutyHourTotal object again." The rule should
just keep firing. If there were some condition on the DutyHourTotal that eventually was
false it
would stop but I am surprised you only see it fire twice and not forever. Perhaps there
are side
effects of setNrHours() that cause one of the other conditions to fail.
*
end