13.4.3. Using Expressions in Process Elements

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

Expressions are evaluated using variable values and are defined using a scripting language such as Python (default) or BeanShell. The scripting language for a process is set in your process template attributes. Table 13.1: Syntax for Logical Operations shows the syntax for logical expressions that you can use in scripts, and Table 13.2: Syntax for Arithmetic Operations shows arithmetic expressions syntax.

Table 13.1:  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 13.2:  Syntax for Arithmetic Operations

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


When you utilize expressions in process templates, you should be aware of how the values of variables are represented and the operations that are supported on them.

You can also use parentheses 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.