| Reference > Rule Languages > ILOG Rule Language > IRL Keywords > after |
after |
PREVIOUS NEXT |
A binary temporal constraint in an event condition. This keyword is used in rule conditions.
[?var:] event className (?eventVar1 after [interval] ?eventVar2);
The after keyword is used in the condition part of a rule in an event condition. A temporal constraint between two events is expressed using the after and before keywords. An interval is of the form [lowerBound, upperBound], where a bound is either an expression evaluating to an integer, or the $ sign which denotes infinity.
Consider that the timestamp of ?event1 is t1 and that the timestamp of ?event2 is t2. The after operator can be expressed as follows:
?event2 after[min,max] ?event1
?event2 after[min,$] ?event1
?event2 after[$,max] ?event1
?event2 after ?event1
rule ReportAlarmPairsToUsers {
when {
?u: User();
?a1: event Alarm();
?a2: event Alarm(?this after[1, 4] ?a1);
}
then {
?u.report(?a1, ?a2);
}
};
Assume that a User instance is in the working memory and that an Alarm instance is inserted. A partial instance of the ReportAlarmPairsToUsers rule will be created and maintained for four ticks. If the User instance is then retracted, the partial instance of the rule will be immediately deleted. An instance of the ReportAlarmsToUsers rule is created on each instance of the User class in the working memory when a second alarm event ?a2 is inserted no greater than four ticks after ?a1.
before, event (in rule conditions), occursin, timeof
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |