[rules-users] Question about collect and sliding windows

Wolfgang Laun wolfgang.laun at gmail.com
Wed Dec 1 11:53:27 EST 2010


On 1 December 2010 17:19, Anais Martinez <amartinez at iti.upv.es> wrote:

>
> > What does your thread do after it returns from fireAllRules?
>
> My thread sleeps five minutes and then it fires again: (intervalLength =
> 5*60*1000):
>

You might as well let the Engine sleep, waiting for news.

If you turn it on, every now and then, you'll get all sorts of delays. Say,
an event arrives 1ms after you've returned from an unsuccessful
fireAllRules()
(there's no "fireRules()" method, is there?), then you won't get any
reaction
until next time round, i.e., 5 minutes later. This may not be as expected.

Regards
-W



> @Override
>    public void run(){
>
>        while(!end){
>            try {
>                Thread.sleep(intervalLength);
>                int nRules = ksession.fireRules();
>                if(nRules > 0){
>                    logger.debug(nRules + " reglas disparadas.");
>                }
>            }
>            catch (InterruptedException e) {
>                logger.error(e);
>            }
>
>        }
>
>    }
>
> >Well, if the events arrive on schedule it should be OK, but what about the
> delayed arrivals?
>
> Ah, ok...
>
> Thank you, again.
>
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Question-about-collect-and-sliding-windows-tp1999562p2000077.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101201/5f994099/attachment.html 


More information about the rules-users mailing list