Try OpenEdge Now
skip to main content
BPM Events User's Guide
The rule language : Rule structure : Priority and parentheses
 

Priority and parentheses

Usual precedence rules for operators apply (and has higher priority than or). At equal priority, the left-most operator is evaluated first, which means that parentheses apply by default from left to right. Note the additional parenthesis around the or expression, in the previous example. The condition above has the following structure:
Expression 1: c1 and (c2 or c3) and c4
Because the operator and has higher priority than or, a non-parenthesized expression like:
Expression 2: c1 and c2 or c3 and c4
would be interpreted as:
Expression 3: (c1 and c2) or (c3 and c4)
The meaning is quite different from Expression 1, where or is evaluated over the results of the two and sub-expressions, as opposed to only c2 and c3. A fully parenthesized expression equivalent to expression 1 is:
Expression 4: ((c1 and (c2 or c3)) and c4)