Expressions Syntax

The syntax used to write expressions and recognition rules in Task Builder is similar to that used for Java expressions. It can contain the following:

Syntax Example
Integer constants 1,2,...9,0
String constants (enclosed in single quotes) String constants can contain the wildcard characters, "*" and "?". * = 0 to n characters of any type
? = A single character of any type
\* = the literal star "*" character
\? = the literal question mark "?" character
\\ = the literal backslash "\" character
Variables

Any string which can contain special characters such as $(dollar sign), .(period), or _(underscore). Variables are commonly used to reference field and screen names in a navigation map (NavMap).

Hostfield1, Screen5, Total_So_Far
Arithmetic Operators (+,-,/,*)

Integer values are typically used to calculate the start and end of table positions.

1 + 4 (returns integer value of 5)
Boolean constants (true, false) true, false

Lower case, as shown.

Comparative Operators (<, >, ==, !=, <=, >=, like)

The right side of the "like" operator can contain a string-pattern to match the string on the left side of the operator. The string pattern can contain the "*" wildcard to specify any characters.

op1 == op2
true if op1 and op2 are equal
op1 != op2
true if op1 and op2 are not equal
op1 > op2
true if op1 is greater than op2
op1 like '*op2*'
true if op1 contains the string op2
Bitwise operators (&, |, ^, ~)

Bitwise operators manipulate the bits that are used to store integer values

.
Attrib1 & BitMaskA Performs a bitwise AND operation on the individual bits of Attrib1 and BitMaskA.
Attrib1 | BitMaskA Performs a bitwise OR operation on the individual bits of Attrib1 and BitMaskA.
Attrib1 ^ BitMaskA Performs a bitwise EXCLUSIVE OR operation on the individual bits of Attrib1 and BitMaskA.
Attrib1 ~ BitMaskA Performs a bitwise NOT operation on the individual bits of Attrib1 and BitMaskA. This is also called a bitwise complement operation.
Logical operators (and, or, not) HostField1 like '*02XX*' and HostField2 like '*Start*'

Use of parenthesis to group elements is supported.

(HostField1 like '*02XX*' and HostField2 like '*Start*') or (HostField4 like '*Ready*')

Functions

Variables followed by an argument list enclosed in parentheses.

It is possible to augment existing functions using the Reflect method.

For explanations of Services Builder functions, including the Reflect method, see Using Functions to Create Expressions.

STRINGAT (10, 10, 5)
Arrays

Lists of items enclosed in braces.

There are no current Services Builder elements using arrays.

{1,2,3,4}   {KeyA, KeyB, KeyC, KeyD}
Related Topics
Bullet Modifying Screen Recognition Rules, Overview
Bullet Using Functions to Create Expressions
Bullet Defining Rules with Expressions
Bullet Sample Expressions
  Attachmate