Formulating and Calculating Expressions

The document describes how you can use the expression editor to formulate and calculate expressions.

Using the Expression Editor

When the expression editor is started, the system automatically fills the list of subscription items or the variables (depending on the context). In general, you can form calculation expressions using the following elements:
  • Subscription items or variables
  • Constants

  • Functions

You add variables or subscription items at the current cursor position in the expression, either by double-clicking on the relevant element in the list or selecting the element and then choosing Insert. Alternatively, you can type in the name of the variable or subscription item in the Expression field. Note that the names need to be enclosed with single quotation marks and are case-sensitive.

From the list of functions, you add functions at the current cursor position in the expression in the same way as you add variables or subscription items. Then you replace the placeholders inserted by the system for function parameters with real variable names or subscription item names, constants, or functions.

Moreover, you can search for functions by choosing Search in the expression editor and entering a search term in the Function Search dialog box. The system searches for your search term in the function names and function descriptions. This search is not case-sensitive. When you have found the function you want, click on it and choose Select. The chosen function is selected in the list of functions of the expression editor and you can copy it from there into the expression.

Since the expression editor is used in various contexts, three typical use cases are described below.

Calculating an Output Expression from Subscription Items

You can use the expression editor to formulate output expressions in notifications. Depending on the use case, you can use subscription items or input parameters of methods, constants, and functions in the output expressions.

Formulating a Boolean Expression

Boolean expressions are used, for example, in trigger conditions of notifications or in exception handling in multiple call destination systems and enhanced notification processing (ENP). The result always has the data type Boolean with the possible values true or false.

Formulating a Branching Condition in a Multiple Call Destination System

Branching conditions in a multiple call destination system are calculation expressions whose result is to be a numeric integer value that is greater than 0. The result is the number of the next step that is to be executed.

Validating an Expression

You can choose the Validate pushbutton to check the expression that has been entered. PCo issues an error message if you have not entered the expression correctly.

Debugging an Expression

You can choose the Debug pushbutton to check which values or texts PCo issues after a tag value is entered:

  1. In the Expression Editor dialog box, choose the Debug pushbutton.

    The Expression Debug dialog box appears.

  2. Enter values for the variables and choose the Evaluate Expression pushbutton to evaluate the expression and populate the Result screen area.

  3. The calculated value is displayed in the Result screen area. Values from array data types or structured data types are displayed in JSON notation.

  4. Choose Close.

Data Types

Choose the Data Types pushbutton to open the data type selection dialog box. There you can select a data type from the PCo data type repository and insert it in the expression.