Order of operation

The order of execution can significantly affect the resulting value. To control order and precedence you use parentheses to group functions. Everything within the parentheses is evaluated first to yield a single value before that value can be used by any operator outside the parentheses. If an expression has nested parentheses, the most deeply nested expression is evaluated first.

When a condition is met, the evaluation ends, using the results of the first successful condition. For (Condition1 AND Condition2) OR (Condition3 AND Condition4) OR Condition5, if the first set (Condition1 AND Condition2) is met, then the remaining OR statements are ignored.

Note:  You can only use Labels and the AND, NOT, and OR operators in your Condition Expression. The Condition Expression cannot contain SQL keywords.

Condition expression example

The following example illustrates multiple expressions for filtering attributes of a physical property (structure) and user rights:

Is the property owner-occupied?
Is the property located in one of the following states: Georgia, Alabama, Arizona?
Is the property height in the number of stories greater than or equal to 5?
Does the user have the security entity named biz_RequestTypeCategory_Envornmental?

Example

Each expression Label is brief and descriptive: OO, GA, AL, SECenv, 5PLUS, AZ. 

Type Description Label
FieldValueExpression gen_Property.OwnerOccupied Equals Yes OO
FieldValueExpression gen_Property.State Equals GA GA
FieldValueExpression gen_Property.State Equals AL AL
SecurityEntity Security Entity Equals biz_RequestTypeCategory_Environmental SECenv
FieldValueExpression gen_Property.NumOfStories Greater Than or Equal 5 5PLUS
FieldValueExpression gen_Property.State2 Equals AZ AZ

Condition expression example

The Labels are used in the Condition Expression along with the AND and OR operators. Additionally, grouping and nesting control the evaluation.

The following example has two major groupings delineated by sets of parentheses. Within each major group, there is a sub-group, also delineated by a set of parentheses.

(OO AND (GA OR AL)) OR (SECenv AND (5PLUS AND AZ))

First group - the AND Parentheses and groupings

The first grouping has two sets of parentheses: 

The first group specifies owner-occupied as OO. You need a set of parentheses for OO. Sub-groups are placed inside the parentheses of the major group.


(OO AND (GA OR AL))

Within the owner-occupied group, the location must be GA or AL. You need a second set of parentheses for the locations GA and AL.
(OO AND (GA OR AL))
Second group - the OR

The second grouping has two sets of parentheses:

The first group is SECenv. You need a set of parentheses for this major group.

(SECenv AND (5PLUS AND AZ))

The second group is the number of stories and location. Place the sub-group within a set of parentheses.
(SECenv AND (5PLUS AND AZ))

The following diagram explains how the sample condition expression is evaluated.

Result

For the expression (OO AND (GA OR AL)) OR (SECenv AND (5PLUS AND AZ))

If the property is owner-occupied and is located in Georgia or Alabama, then the evaluation ends because the condition has been met. The OR portion is ignored.
However, if there are no properties that are owner-occupied in either Georgia or Alabama, then the OR expression is evaluated. The OR portion looks for:
user view rights to RequestTypeCategory_Environmental
and the property must be in Arizona with a minimum height of 5 stories

Summary

The examples provided in this topic use nested groupings along with the AND and OR operators. Keep in mind that your needs may vary. Additionally, plan ahead. Determine your Display Conditions and use brief Labels. After you have defined your Display Conditions, then you are ready to compose the Condition Expression.