After talking to Stuart and Jason and Dave, along with reading the
various JRules papers, it seems there are a few concepts of time:

        1) Time as a condition event:

                when:
                        cinderalla.getLocation() == ROYAL_PALACE;
                        clock.strikesMidnight();        

        Rudimentary speaking, this could be accomplished by asserting
        a 'now' Date object into the working memory every minute,
        but that's a woefully bad implementation.  I think a syntax
        adjustment for wall-clock time would be required:

                when at midnight:

                        cinderalla.getLocation() == ROYAL_PALACE;

        That'd keep us from checking any part of the rule unless
        the time part is matched.

        2) Time as how long a condition should hold:

                when:
                        msg.hasBeenSent();

                after 6 hours:

                        ! msg.hasBeenRepliedTo();

        So, match all of the {when}, and then, evaluate the {after}
        upon time expiration.  While this could be modelled using
        the (1) case above, and two rules, I think additional syntax
        to make it simple to do it in one rule would be nice.

        Here's the 2-rule version:

                rule #1
                -------
                when:
                        msg.hasBeenSent();
                then:           
                        assertObject( new ReplyWaiter( msg ) );


                rule #2
                -------
                when at 4pm:
                        ! replyWaiter.receivedReply()

        3) Additionally, while waiting, we need to decide
        (probably on a rule-by-rule basis) if we watch the conditions
        during the interval, and cacel if the conditions become
        false any time during the interval; or if we only care
        about the conditions at interval expiration, not worrying
        if their truth value changed many times during the interval.

-bob


_______________________________________________
drools-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/drools-interest

Reply via email to