Created
November 18, 2015 13:44
-
-
Save DuncanDoyle/c82063ff3b2d5042252a 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 | |
declare SimpleEvent | |
@role( event ) | |
@timestamp( timestamp ) | |
@expires( 120s ) | |
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 | |
rule "rule_2" | |
when | |
$s: SimpleEvent () | |
not SimpleEvent (this != $s, timestamp after[0, 30s] $s.timestamp) | |
then | |
System.out.println("With timestamp in temporal operators: 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