I'm beginning to think that there is no min or max accumulates in 5.0.  If
that's the case, then the accumulate function gets way too complicated (I
can see why I was asked not to use accumulate!)

In that case, is using java in the Then segment the way I've shown the best
technique?

Here's the accumulate I was asked to simplify, that does work:

        $lh : BeginAndEndDates() from accumulate(
                ServiceLineDetail(
                        serviceRelatedDates != null,
                        serviceRelatedDates.serviceDates != null,
                        $beginDate : serviceRelatedDates.serviceDates.beginDate,
                        $endDate : serviceRelatedDates.serviceDates.endDate
                        )
                        from $claim.serviceLineInfoList,
                init(BeginAndEndDates lh = new BeginAndEndDates(); boolean 
first = true;),
                action(
                        if (first && $beginDate != null) 
{lh.setBeginDate($beginDate); first =
false; };
                        if ($beginDate != null && 
$beginDate.isBefore(lh.getBeginDate()))
lh.setBeginDate($beginDate);
                        if ($endDate != null && 
$endDate.isAfter(lh.getEndDate()))
{lh.setEndDate($endDate); };
                        ),
                result(lh)
                );



--
View this message in context: 
http://drools.46999.n3.nabble.com/Find-the-lowest-and-highest-dates-tp4028231p4028239.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to