BPM Events User's Guide

The section explains various date functions you can use in the rule language.

The standard arithmetic operators apply for date comparison. For example, the following relational expressions are syntactically correct:

YEAR:1997/MONTH:7 < EVT_1.date

EVT_1.date + 15*DAY >= YEAR:1999/MONTH:6/D:15

Two dates are equal only if their date-units contain the same value, pair by pair. For example, the condition below is true:

YEAR:1997/MONTH:7 != YEAR:1997/MONTH:7/DAY:15

The following inequalities hold:

YEAR:1997/MONTH:7/DAY:30 < YEAR:1997/MONTH:8

YEAR:1998 < YEAR:1998/MONTH:2

The dueDate and duration functions are based on regular time. The dueDate function returns the due date by adding the duration in milliseconds to a given date, as shown in the following example.

dueDate (startDate: date, duration:int): date

The following sample returns the due date by adding two hours to the event date:

val dt1 : date = dueDate(evt1.date, 2*60*60*1000) ;

The dueDate and duration functions are based on regular time. The duration function returns the duration, or the difference in time between the end date and the start date, in milliseconds. See the following example.

duration (startDate: date, endDate: date): int

The following sample returns the duration between the event date and the due date (dt1) calculated in the previous dueDate sample. It returns a value of two hours, using java.util.Date and java.util.Calendar classes:

val dur1 : int = duration(evt1.date, dt1) ;

The function NOW returns the current date.

© 2017 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.

Progress® OpenEdge® Release 11.7