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 *
<WF_USER_field> *
User information
Assigned user. field *
<WF_ASSIGNEE_field> *
Assignee user information
Requester. field *
<WF_REQUESTER_field> *
Requester information
Action initiator. field *
<WF_INITIATOR_field> *
Action initiator information
Process. Id
<WF_PROCESS_ID>
Process identifier
Process. Name
<WF_PROCESS_NAME>
Process name
Process. Description
<WF_PROCESS_DESC>
Process description
Process. Status
<WF_PROCESS_STATUS>
Process status
Process. FormUrl
<WF_PROCESS_FORM_URL>
Process form URL
Process. Version
<WF_PROCESS_VERSION>
Process version
Action. Id
<WF_ACTIVITY_ID>
Action identifier
Action. Name
<WF_ACTIVITY_NAME>
Action name
Action. Description
<WF_ACTIVITY_DESC>
Action description
Current action. Id
<WF_ACTIVITY_INST_ID>
Action instance identifier
Current action. Name
<WF_ACTIVITY_INST_NAME>
Action instance name
Current action. Creation date
<WF_ACTIVITY_INST_CREATION_DATETIME>
Action creation date
Current action. Deadline
<WF_ACTIVITY_INST_LIMIT_DATETIME>
Action deadline
Current action. Pre-overdue days
<WF_ACTIVITY_INST_PREOVERDUE_DAYS>
Number of days before the action becomes overdue, rounded up to the nearest day
Current action. Pre-overdue hours
<WF_ACTIVITY_INST_PREOVERDUE_HOURS>
Number of hours before the action becomes overdue, rounded up to the nearest hour
* field: See the next table.
See Examples of macros below for examples of values for the macros listed above.

User macro suffixes

Field
Description
LASTNAME
Last name
FIRSTNAME
First name
USERNAME
Name of the user
MANAGER
Manager's username
MANAGER_LASTNAME
Manager's last name
MANAGER_FIRSTNAME
Manager's first name
EMAIL
Email address
PHONE
Telephone number
MOBILE
Mobile telephone number
PAGER
Pager number
FAX
Fax number
OFFICE
Office number
DEPARTMENT
Department number
COMPANY
Company
JOBTITLE
Title
INITIALS
Initials
TITLE
Civic status
EMPLOYEENUMBER
Employee number
EMPLOYEETYPE
Type of employee

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
FILENAME
TEXT
File name
SIZE
NUMERIC
File size in bytes
CONTENTTYPE
TEXT
File content type
DESCRIPTION
TEXT
File description
DATELASTMODIFIED
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
<WF_USER_FIRSTNAME> <WF_USER_DEPARTMENT> will give "John Accounting"
Assigned user.field
<WF_ASSIGNEE_EMPLOYEENUMBER> <WF_ASSIGNEE_EMPLOYEETYPE> will give "11225 Permanent"
Requester.field
<WF_REQUESTER_COMPANY>
<WF_REQUESTER_LASTNAME> will give "My company Smith"
Action initiator.field
<WF_INITIATOR_FIRSTNAME>
<WF_INITIATOR_LASTNAME> will give "John Smith"
Process.Id
12
Process.Name
"2_LEVELS_APPROVAL"
Process.Description
"2 levels approval"
Process.Status
"ACTIVE"
Process.FormUrl
"http://mycompany.com/wfgen/wfapps/webforms/MACRO_TEST_2/V1/Default.aspx"
Process.Version
1
Action.Id
2
Action.Name
"INITIATES"
Action.Description
"The Requester initiates the request"
Current action.Id
2
Current action.Name
"2-VALIDATES"
Current action.Creation date
2019-04-20T20:23:07Z
Current action.Deadline
2019-04-30-T20:25:25:46Z
Current action.Count
2
Request.Id
1701

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:
1
<configuration>
2
<appSettings>
3
<add key="MySecretKey1" value="4n(#N$HT0$Bohv!" />
4
<add key="MySecretKey2" value="9et9tzV{Hnn]EsDE" />
5
<add key="MySecretKey3" value="e#8BHvXa8N*LvFaY" />
6
<add key="EngineMacroAppSettings" value="MySecretKey1, MySecret*" />
7
</appSettings>
8
</configuration>
Copied!