You use the Dynamic Expression Editor dialog box to define specific behavior in a property of a model element. A dynamic expression is a formula that you define for generating a dynamic field value. The Dynamic Expression Editor dialog box enables you to define dynamic expressions and then validate their syntax. For more information, see Dynamic Expression Editor Dialog Box.
For examples of many commonly-used functions in dynamic expressions, see Frequently-Used Functions.
1. Click the Function (fx) icon displayed to the right of the attribute or property field into which you want to enter a dynamic expression. The Dynamic Expression Editor dialog box is displayed.
2. In the Function pane on the right of the dialog box, expand the node for the category that contains the function that you want to use. Each function has an explanatory tooltip.
Make sure that the icon of the function that you choose matches the required data type. You can see the text displayed above the Expression pane to check what data type is expected in the result: Edit a dynamic expression that returns a result of data type: <Data_Type>.
3. Drag the required function to the Expression pane on the left of the dialog box.
For example, you may want to expand the Conditional Functions node and use the IF function. In this case, the following expression is displayed in the Expression pane:
where test is any value or expression that can be evaluated to TRUE or FALSE, expr1 is the value that is returned if test is TRUE, and expr2 is the value that is returned if test is FALSE.
4. Use the displayed formula to create your custom expression. You can write the expression by entering free text in the Expression pane, by dragging additional functions from the Function pane to the Expression pane, or by using a combination of the two methods.
You can use the Data Fields node to locate another field whose value you want to include in your expression. To do this, expand the node and drag the field to the required position in the expression.
For more information about the required syntax, see Frequently-Used Functions.
5. Click anywhere in the Description field to open the Description dialog box. Enter any text related to the dynamic expression, such as a reminder or note to other users, and click OK.
6. Click Check to ensure that the dynamic expression is valid. If an error occurs, an explanatory message is displayed. For more information about possible messages, see Messages in the Dynamic Expression Editor Dialog Box.
7. When your expression is valid, click OK. The expression is displayed in the property or attribute field from which you accessed the Dynamic Expression Editor dialog box.
For a step-by-step example of defining a dynamic expression, see Defining a Dynamic Expression.