Macros
Overview
The following macros can be used in transition conditions or in the additional parameters of application type actions. They will be replaced by their associated value during process execution.
List of available macros
Macro | Tag | Value |
Current user. field * |
| User information |
Assigned user. field * |
| Assignee user information |
Requester. field * |
| Requester information |
Action initiator. field * |
| Action initiator information |
Process. Id |
| Process identifier |
Process. Name |
| Process name |
Process. Description |
| Process description |
Process. Status |
| Process status |
Process. FormUrl |
| Process form URL |
Process. Version |
| Process version |
Action. Id |
| Action identifier |
Action. Name |
| Action name |
Action. Description |
| Action description |
Current action. Id |
| Action instance identifier |
Current action. Name |
| Action instance name |
Current action. Creation date |
| Action creation date |
Current action. Deadline |
| Action deadline |
Current action. Pre-overdue days |
| Number of days before the action becomes overdue, rounded up to the nearest day |
Current action. Pre-overdue hours |
| Number of hours before the action becomes overdue, rounded up to the nearest hour |
Current action. Pre-overdue minutes |
| Number of minutes before the action becomes overdue, rounded up to the nearest minute |
Current action. Pre-overdue seconds |
| Number of seconds before the action becomes overdue, rounded up to the nearest second |
Current action. Overdue days |
| Number of days that the action is overdue, rounded down to the nearest day |
Current action. Overdue hours |
| Number of hours that the action is overdue, rounded down to the nearest hour |
Current action. Overdue minutes |
| Number of minutes that the action is overdue, rounded down to the nearest minute |
Current action. Overdue seconds |
| Number of seconds that the action is overdue, rounded down to the nearest second |
Current action. Count |
| Number of completed instances for the current action |
Request. Id |
| Request identifier (process instance) |
Request. Relative Id |
| Request relative identifier |
Request. Month relative Id |
| Request month relative identifier |
Request. Year relative Id |
| Request year relative identifier |
Request. Name |
| Request name (process instance) |
Request. Creation date |
| Request creation date (process instance) |
Request. Deadline |
| Request deadline (process instance) |
Action. Participant name |
| Action participant name |
System. Date |
| System date |
System. Date/time |
| System date/time |
System. Time |
| System time |
System. Language |
| User system language |
System. Null |
| Enable process designer to reinitialize a PDF form field value to Null |
System. ApplicationBase Url |
| Returns the application root URL (e.g. |
System. ApplicationUrl |
| Returns the WorkflowGen application URL (e.g. |
System. ApplicationPortal ScriptUrl |
| Returns the WorkflowGen application portal page URL (e.g. |
System.Guid |
| System-generated globally unique identifier Important: The generated GUID will be the same when used in standard action parameters except when the scripting option is enabled, in which case each expression will have a unique GUID. |
Parent. Process Name |
| Returns the parent process name in a sub-process action |
Parent. Process Version |
| Returns the parent process version in a sub-process action |
Parent. Request Id |
| Returns the parent request ID in a sub-process action |
Parent. Current action Id |
| Returns the parent current action ID in a sub-process action |
Web configuration app settings |
| Macros created based on custom web configuration app settings (see the Web configuration app settings macros section) |
* field
: See the next table.
See Examples of macros below for examples of values for the macros listed above.
User macro suffixes
Field | Description |
| Last name |
| First name |
| Name of the user |
| Manager's username |
| Manager's last name |
| Manager's first name |
| Email address |
| Telephone number |
| Mobile telephone number |
| Pager number |
| Fax number |
| Office number |
| Department number |
| Company |
| Title |
| Initials |
| Civic status |
| Employee number |
| Type of employee |
| Postal address |
| Zip code |
| City |
| State |
| Country |
| SID |
| Extended attribute 1 |
| Extended attribute 2 |
| Extended attribute 3 |
| Extended attribute 4 |
| Extended attribute 5 |
Using macros
You can use macros in the transitions and additional notification conditions or in the action parameters to send the value of the macro to the parameter value by choosing one macro from the list or by concatenating several macro codes as a text value.
Example 1:
If you want to send the username of the requester in the action's REQUESTER_USERNAME
field, you have to add an additional parameter with the following settings:
Parameter name:
REQUESTER_USERNAME
Send the value of a macro:
Requester.Username
Example 2:
If you want to send the first name and the last name of the requester in the action's REQUESTER_NAME
field with a space in between the two, you have to add an additional parameter with the following settings:
Parameter name:
REQUESTER_NAME
Send the value of a text:
<WF_REQUESTER_FIRSTNAME>
<WF_REQUESTER_LASTNAME>
File data macros
Access to the file properties
In transition or notification conditions, you can use the following macros on file type process data to access the file properties.
Field | Type | Description |
| TEXT | File name |
| NUMERIC | File size in bytes |
| TEXT | File content type |
| TEXT | File description |
| DATETIME | Date of last modification of the file |
Syntax examples
The following examples assume you have a file type data called MY_FILE
.
Example 1:
Rule: Check if the file name contains the keyword "report":
Method:
InStr(1,<MY_FILE.FILENAME>,"report",1) <> 0
Example 2:
Rule: Check if the file size is less than 1 MB:
Method:
<MY_FILE.SIZE> < 1024
Example 3:
Rule: Check if the file is a Microsoft Word document:
Method:
<MY_FILE.CONTENTTYPE> = "application/msword"
Example 4:
Rule: Check if the file was modified today:
Method:
<MY_FILE.DATELASTMODIFIED> > [Date]
Check if a file exists
You can also use the name of the data to check if the file exists in the process by using the IsNull()
function.
Example:
If you have a FILE type data called MY_FILE
, you can use the syntax below in a condition to check if the file exists:
IsNull(<MY_FILE>)
Examples of macros
The following table shows examples of the macros listed above.
Macro | Example |
Current user.field |
|
Assigned user.field |
|
Requester.field |
|
Action initiator.field |
|
Process.Id |
|
Process.Name |
|
Process.Description |
|
Process.Status |
|
Process.FormUrl |
|
Process.Version |
|
Action.Id |
|
Action.Name |
|
Action.Description |
|
Current action.Id |
|
Current action.Name |
|
Current action.Creation date |
|
Current action.Deadline |
|
Current action.Count |
|
Request.Id |
|
Request.Relative Id |
|
Request.Month relative Id |
|
Request.Year relative Id |
|
Request.Name |
|
Request.Creation date |
|
Request.Deadline |
|
Action.Participant name |
|
System.Date |
|
System.Date/time |
|
System.Time |
|
System.Language |
|
System.Null |
|
Application.BaseUrl |
|
Web configuration app settings macros
This feature helps to simplify the deployment of business processes in a multi-instance WorkflowGen environment by allowing you to define common data or instance-specific data as a key-value pair that can be used in your process by way of a macro in action parameters, in transition conditions to control the flow, and in action notifications instead of hard-coding these data in the process definition.
You can create your own macros by defining custom app settings in the WorkflowGen web configuration file.
You must use the EngineMacroAppSettings
configuration parameter to define your custom macros. You can specify the exact key name, or use a prefix followed by *
(asterisk) as shown in the example below, which adds the three custom macros (<WF_APP_SETTING_MySecretKey1>
, <WF_APP_SETTING_MySecretKey2>
, and <WF_APP_SETTING_MySecretKey3>
).
Example
The <WF_APP_SETTING_MySecretKey1>
, <WF_APP_SETTING_MySecretKey2>
, and <WF_APP_SETTING_MySecretKey3>
macros will be available at design and runtime with the app setting below in the web.config
:
Last updated