Expression Builder
About this task
The Expression Builder dialog box helps you develop an expression by displaying field names, attachments, workflow groups, XML data fields, system fields, and partner links for you to select. In addition, if functions are appropriate in the expression, you can choose the appropriate function and this dialog box displays the function name and syntax, as well as providing access to the online Help.
To access the Expression Builder dialog box, click Expression Builder in any field where an expression is permitted.
The name of the item for which you are building the expression displays in the title bar of the window. Build the expression in the expression area by inserting the names of existing fields and operators, and by typing directly in the expression area.
To use the names of data fields, attachments, workflow groups, XML data fields, and other items either defined in this workflow or inherited from a parent workflow
Procedure
Results
To use Guid Fields in the expression
- In the Expression Builder window, click Business Object Fields. The supported properties are displayed in the Properties table.
- Select the property from the table and click Insert.
- When you are finished defining the expression, click OK to save and close the window.
To use Partner Links in the expression
If you are invoking web services in a workflow, you might want to modify the header of the invoking message at runtime to either invoke a different web service than the one defined in the partner link, or to pass a user name and password to a web service that requires authentication.
- Select Partner Links from the list.
- Select the appropriate partner link.
- Click Insert to insert the header information into the expression.
- Edit the header template to specify either an alternate WSDL URL,
an alternate processing endpoint, or a logon and password for authentication.
Note that you must modify the expression to make it a valid string. That means that you must add double-quotes at the beginning and end of the string, and before any existing double-quotes.
For example workflows demonstrating how to modify the partner link header, see examples 5 and 7 in Web Services examples.
To use functions in the expression
- Select Functions from the list.
- Select the appropriate category.
- Select the appropriate function from the list in the right column.
- Click Insert to insert the function into the expression.
- Edit each function parameter to specify the appropriate values, such as the name of a data field.
To define an expression for an attachment
- Click Browse, then locate and insert a document, folder, or other file.
To define an expression for a workflow group
- Click Browse, then locate and insert a user name.
When you browse for a document, folder, file name, or a user or group name, the selected item is inserted into the expression area in the format required by workflow system.
You can also assign a user to a workflow group using one of the following:
- "@" character and a system-defined user number. The syntax is @<user-ID>
where <user-ID> is an integer constant.
For example, if WfGroupA is the participant for the third step in the workflow and you want user number 50 to process that step, enter the following on the Assignment tab of a previous step in the workflow. Note that @50 is assigned to the first element of the workflow group.
Field name Expression WfGroupA[1] "@50"
- A data field containing the user name. For example, use @<user-field-name> where <user-field-name> can be:
- An integer field, single or array, that represents user-IDs
- A string field, single or array, that represents a user name or a workflow group
In the following example entry on the Assignment tab, the userstring data field holds the participant name.
| Field name | Expression |
|---|---|
| WfGroupA[1] | "@userstring" |
Use the following syntax on the Assignment tab (After Completion) to assign the numeric ID of the participant at the current step to an element in a workflow group that will process a subsequent step.
| Field name | Expression |
|---|---|
| WfGroupA[1] | "@"+numbertostring(F_BoundUser) |
Since the @ symbol has a special meaning in specifying a participant name in a workflow, you should observe the following rule for using the @ symbol in user names:
- Do not define a user name with the initial character @, followed
only by digits, for example @12345. If this user name is assigned
as a participant for a workflow step, the system will route the work
to the user whose userID in the workflow system is 12345.
The system will correctly route work to participants with user names of @123abc or @abc123 since these names contain both letters and numbers.