I need to handle a situation where I am notified when 2 different facts are received in my working memory within 30 seconds of each other. Then I want the system to remove the facts from the working memory after they are handled.
For example, say I want to be notified when the system sees a login from Bob and then he checks his email within 30 seconds.
I know that sounds banal, however, this is a proof-of-concept use-case and it's for a very high-level presentation.
I've tried this:
rule "Bob Login Rule" dialect "java"
when
Login( username == "bob" ) over window:time(30s);
UserAction (action == UserAction.CHECK_EMAIL) over window:time(30s)
then
System.out.println("Bob logged in and checked his email");
end
Thanks in advance.