Re: [rules-users] count with nested condition

2008-07-30 Thread Yoni Mazar
Hi, Yes, your proposed solution does work. Unfortunately, the accumulate-count function is not well described in the documentation. In addition, I still have a concern. The required business functionality is simple, but the implementing rule is very technical and not trivial. I can hardly expect

Re: [rules-users] count with nested condition

2008-07-30 Thread Edson Tirelli
Well, actually my previous rule will fire a false positive if any lab event has more than one 1 result greater than 1.8. Lets try it again: Number( intValue 1 ) from accumulate( LabEvent( eval( dateWithinLastMonths(effectiveTime,1)), results : laboratoryResult ) and exists(

[rules-users] count with nested condition

2008-07-29 Thread Yoni Mazar
Hi all, Our object deals with the clinical domain. We have a class LabEvent that represents a visit in the laboratory. Each event is associated (using the laboratoryResult association) with one or more LabResult objects (children), each represents the results of a particular test. in the rule

Re: [rules-users] count with nested condition

2008-07-29 Thread Edson Tirelli
What about: Number( intValue 1 ) from accumulate( LabEvent( eval( dateWithinLastMonths(effectiveTime,1)), results : laboratoryResult ) and LabResult( value 1.8 ) from results, count( 1 ) ) Accumulate supports multiple patterns and has the count() function.