[rules-users] How to design a rule using collect for filtering? Thanks.

Anh Vuong anhtvuong at yahoo.com
Fri Aug 10 19:54:50 EDT 2007


Hi,
  I'd like to use keyword collect to do my filtering but its behaviour confused me, please advise. I greatly appreciate your help.
   
  Problem 1:
   
  when
  eventList : LinkedList(size == 5)
  from collect( Event(text matches ".*rule5.*" ))
  
  then
  System.out.println("rule5 is fired " + eventList.size());
   
  I still do not see any log msg after adding 5+ events. Is something wrong with my rule?
   
  Problem 2:
   
  when
  event: Event(text matches ".*rule5.*" ))
  eventList : LinkedList(size == 5)
  from collect( Event(text == event.text)
  
  then
  System.out.println("rule5 is fired " + eventList.size());
   
  After adding 5 events, I see 5 log msg instead of one as I'd expect.
  If I add more events, I will see more log. How do I tell LHS  to reset the count from 0.
  Basically, I want to take 1 event out of 5 similar events (suppressing filtering). So if there are 10 similar events, my RHS should activate 2 times, not 10 times.
   
  Thanks,
  -av
   

       
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070810/6f439242/attachment.html 


More information about the rules-users mailing list