Zeitpunkte vergleichen
Überprüfen Sie, ob ein Zeitpunkt vor oder nach einem anderen Zeitpunkt liegt oder zeitgleich mit einem anderen Zeitpunkt ist.
- is after und is after or the same as.
- is before und is before or the same as.
- is at the same time as.
Beispiel: the arrival time of 'the first flight' is before the departure time of 'the second flight'.
Die folgende Regel prüft, ob mindestens eine Stunde zwischen der Ankunft des ersten Flugs und des Abflugs des zweiten Flugs liegt.
definitions
set 'flight1' to a flight in the flights of 'the customer';
set 'flight2' to a flight in the flights of 'the customer'
where the scheduled departure time of this flight is after the scheduled arrival time of 'flight1';
if
the scheduled departure time of 'flight2' is before 1 hour after the scheduled arrival time of 'flight1'
then
print "Less than 1 hour of transit time";
Zeitpunkt und Tageszeit vergleichen
Die Zeitzoneninformation wird im Zeitpunkt gespeichert. In einem Ereignis ist die Zeitzoneninformation beispielsweise in der Zeitmarke angegeben.
Die folgende Regel prüft, ob ein Kaufereignis am Nachmittag in der Zeitzone stattgefunden hat, in der das Ereignis eingetreten ist.
when a purchase event occurs
where the time of day of this purchase event is after or the same as 12:00 PM
then
print "Afternoon purchase.";
Zeitinstanzen vergleichen
Die folgende Regel vergleicht die Zeitinstanz zweier Zeitpunkte unabhängig von der jeweiligen Zeitzone.
when a flight departure event occurs
where this flight departure event is after the scheduled departure time of 'the flight'
then
print "The flight's departure was late";
when a flight departure event occurs
where this flight departure event is at the same time as the scheduled departure time of 'the flight'
then
print "The flight departed on time";
Ereignisse vergleichen
Die folgende Regel prüft, ob die Neuterminierung eines Flugs stattfindet, nachdem das Gepäck in das Flugzeug geladen wurde.
when a flight rescheduled event has occurred 5 minutes ago, called 'the flight rescheduled'
definitions
set 'the bag loaded' to a bag loaded event;
if
'the flight rescheduled' is after 'the bag loaded'
then
print "The flight is rescheduled, please unload the bags from the plane";