hi,

i have a rule file as follows:

declare Event 
    @role( event ) 
end 

declare window Ticks
    Event()
        over window:time(1m )
end

rule "More than  5 file added events"
when  
    $p: RuleContext() 
    Number(intValue > 4) from 
    accumulate( $e :Event (name == "new file added") from window Ticks, count($e) )   
then 
      Event event = new Event("too many files added last minute",$p.getOldContext().getParent(),new                                             Date());
       event.display();
end 


this rule gets fired only if i add more than 4 files all at once..
say if i add first 2 files within the first 10 seconds, next two files after the 20th second and next two files after 40th second, this rule is not getting fired.. ( there are 6 file added events in the window over past 1 min and the rule should have got fired ). what is the problem with the current rules and how can i modify it to meet my requirement?


Thanks.