Using the Expression Editor (Magic xpi 3.x)
To create an expression with the Expression Editor:
-
Click any button to open the Expression Editor.
-
Build an expression in one of the following ways:
-
By entering the different parts of the expression manually.
-
By using the auto-complete facility, which is accessed by pressing Ctrl+SPACE. This searches the variables and the functions, and gives you a list of appropriate matches in the form of a drop-down list. By double-clicking on the list, you can select the required variables or functions to include in the expression.
If you are using a Chinese machine, whose Region and Language dialog box's Format field is set to Chinese, the auto-complete facility is accessed by pressing SHIFT+SPACE. (Since version: V3 SP3)
-
By activating the drop-down list of variables and functions, as previously described, by using Ctrl+SPACE. You can then select the required variables or functions by double-clicking on the main drop-down list.
If you are using a Chinese machine, whose Region and Language dialog box's Format field is set to Chinese, the drop-down list of variables and functions is accessed by pressing SHIFT+SPACE. (Since version: V3 SP3)
-
By clicking one of the following buttons, and then selecting the required variables or functions:
|
|
|
|
Ctrl+2
|
Opens the Functions list.
|
|
Ctrl+1
|
Opens the Variables list.
|
|
Ctrl+3
|
Opens the Environment Variables list.
|
|
Ctrl+4
|
Opens the ODS list.
|
|
Ctrl+5
|
Opens the Source Nodes list. This is only enabled when editing an expression in the Data Mapper.
|
|
Ctrl+6
|
Opens an operating system file dialog box with which you can select a file. Once a file is selected, its full location is imported into the Expression Editor. Note that only the path and name are imported, not the contents.
|
-
Click Verify to check that your condition is a valid Boolean expression.
-
Click OK to create the new expression. The Expression Editor is closed and the expression you created is displayed in the Flow Editor.
Click Clear to clear the Condition field.
Click Cancel to close the Expression Editor without creating a new expression.
Note:
|
-
When you build conditions in any of these ways, the Boolean operators should be added manually.
-
Text operations and concatenations must be done for string variables. The Expression Editor does not support concatenation of the BLOB variable.
-
When you want to concatenate information to an Alpha variable, you need to use the ampersand (&) character.
-
For logical variables, you can use True or False as well as 'TRUE'LOG and 'FALSE'LOG.
-
Once you have selected a variable or function from the Open Assistor or Functions list, you have to press SPACE if you want to use these lists again.
-
When you select an XML path using the toolbar button, one space will be added at the end of the path to distinguish it from operators that come after the path. When you type the node path in an expression, you need to add the space manually.
-
You can use Ctrl+F to access the Open dialog box. You can then select an expression from a file.
|
|
You can also create or edit new flow, context, or global variables on-the-fly by right-clicking Variable in the flow's context menu. In the Variables for Flow dialog box, select the tab corresponding to the type of variable that you want to add or edit. Here you can add or edit the variable, and it is immediately available for use in the Expression Editor. You can also use the Expression Editor's Variable button to do this.
Note:
|
An example of a valid Boolean expression:
CustomerID = 'Group A' + SSNumber
Where CustomerID and SSNumber are Flow Variables and Group A is a text string. This will create a Customer ID that is made up of the word Group A and a predefined SSNumber. The text string 'Group A' must be enclosed in single straight quotation marks (' '), and there must be a space between the variable or string and the operator.
|
|
To enhance the Expression Editor's ease-of-use, you can define specific colors for the variables, functions, and literals. Click here for further information.