Created
November 17, 2015 15:20
-
-
Save DuncanDoyle/7bb7f2fbfb87eaedccb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jboss.ddoyle.drools.rules | |
import org.jboss.ddoyle.drools.model.SimpleEvent | |
import org.jboss.ddoyle.drools.model.NoExpirationSimpleEvent | |
declare SimpleEvent | |
@role( event ) | |
@timestamp( timestamp ) | |
@expires( 10s ) | |
end | |
declare NoExpirationSimpleEvent | |
@role (event) | |
@timestamp ( timestamp ) | |
@expires ( 100d ) | |
end | |
rule "rule_1" | |
when | |
$s: SimpleEvent () | |
not SimpleEvent (this != $s, this after[0, 30s] $s) | |
then | |
System.out.println("No event within 30 seconds of this event: " + $s.getId()); | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment