Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Time operations and expressions : Date expressions : General date expressions in rule language
 
General date expressions in rule language
It is possible to construct a date with expressions in place of the values of the date units. For example:
YEAR:event1.myYear/MONTH:1/DAY:(3 + toInt(event1.myDay))
Parenthesize any composed expression (as in the DAY unit above).
The event attribute date is of type Date, and can therefore be used at any place a date value is authorized. The following condition is true if the time stamp (origination date) of the event event1 is later than or same as January 15th, 2000:
(event1.date >= YEAR:2000/MONTH:1/DAY:15)
Convert an event attribute that represents a Java long format of a date into a type Date with the function toDate() (Refer to Dateconversion functions ). In that case, use the following date expression:
(toDate(event1.duedate) >= YEAR:2000/MONTH:1/DAY:15)
Syntax:
DateExpr ::=
Year_unit ["/" Month_unit ]["/" Day_unit ]["/" Hour_unit ]["/"Min_unit ]["/" Sec_unit]
Year_unit ::= "YEAR:" <numeric_expression>
Month_unit ::= "MONTH:" <numeric_expression>
Day_unit ::= "DAY:" <numeric_expression>
Hour_unit ::= "HOUR:" <numeric_expression>
Min_unit ::= "MIN:" <numeric_expression>
Sec_unit ::= "SEC:" <numeric_expression>
The following expression is still a valid date, though the Month unit is missing between Year and Day (replace it by its default value "1"):
YEAR:1998/DAY:15/HOUR:8