Create a date and nullable date variable
Use the Date and Nullable date variable to set the date in a process or business rule.
You can use the @Today macro to get the current date, or a past/future date by adding or subtracting the number of days. For example, to get the date 7 days before the current date, specify the variable value as @Today-7.
When you create a job on a process or use a business rule that is using @Today, at runtime, the value of the variable is displayed as the current date, or current date + (plus) or - (minus) the number of days specified (if any).
When you create a job on a process that has an initialization variable using @Today, the runtime value of the variable is displayed as the current date, or current date + (plus) or - (minus) the number of days specified (if any). The time is set to 12 AM at runtime. However, you can change the date and time, as required.
- Open the process map in which to create the variable.
-
On the process modeling bar, click
Variables and click
New.
The New variable dialog box is displayed.
-
Enter a unique
Name for the variable.
By default, the name of the variable becomes the ID of the variable; however, you can change the ID if needed.
- On the Type list, select Date or Nullable date. (Default: String)
- Optional. To use the variable for process initialization, select Initialization.
-
To enter a
Value, do either of the following:
-
Static: You can set the Date variable value either by selecting the required date and time using the calendar picker or by clicking fx and using the @Today macro to get the current date or past/future date. For example, to set the date as 5 days from the current date, set the value as @Today+5.
When you create a job on a process or use a business rule that has a date variable using @Today, at runtime, the value of the variable is displayed as the current date, or current date + (plus) or - (minus) the specified number of days (if any).
When you create a job on a process that has an initialization variable using @Today, the runtime value of the variable is displayed as the current date, or current date + (plus) or - (minus) the specified number of days (if any). The time is set to 12 AM at runtime. However, you can change the date and time, as required.
-
Expression: Right-click in the rule editor box to enter an expression using process variables, server variables, functions, or error codes.
For the expression to be valid, you must enter the date or nullable date in quotes. For example, "13/04/2022" is a valid expression.
-
-
Under
Variable display properties, the following display properties are available
for Date and Nullable date variables:
- Label text: By default, the variable name is displayed as the label text. You can change the label text if you wish to display a longer piece of text than the variable name.
- Show time: If selected, displays the time element at runtime.
- Min date and Max date: Enter the minimum and maximum dates using a calendar picker.
-
Click
Add and close.
On generating a Create new job or Activity form for a process that has an initialization variable set with display properties, the configured properties are reflected in the corresponding controls added to the form.
-
This applies to capture and non-MFP forms only.
-
The Control type property does not apply to business rule or custom services as they do not have forms associated with them.
The date variable appears on the Variables page. -
- Save the process.