A.8. Defining Expressions

Expressions can be used in process definitions for evaluating the following conditions:

Expressions are evaluated using the variable values and a scripting language which is BeanShell by default. BeanShell uses Java syntax for expressions. However, because expressions are specified in XML files, BeanShell also supports special syntax for characters (such as &, <, > and so on) that are not allowed in XML. Table 2: Syntax for Logical Operations shows the syntax for logical expressions and Table 3: Syntax for Arithmetic Operations shows arithmetic expressions syntax.

Table 2:  Syntax for Logical Operations

Logical OperationSyntax
and@and
or@or
not!
not equal to!=
equal to==
greater than (>)@gt
greater than equal to (>=)@gteq
less than (<)@lt
less than equal to (<=)@lteq


Table 3:  Syntax for Arithmetic Operations

Arithmetic OperationSyntax
addition+
multiplication*
integer or real division/
modulo%


While defining expressions you should be aware of how the values of variables are represented, and the operations that are supported on them.

You can also use parenthesis for grouping sub-expressions, for example:

x @lt 2*y @and (x @lt 10 @or x @gt 20)


Release 18.2 - © ANSYS, Inc. All rights reserved.