Server Administration > Change Packages for SCM > Change Package Reviewer and Watcher Rules > Writing Logical Expressions
  
Writing Logical Expressions
This section describes how a logical expression is written in the reviewer/watcher XML file notation.
For example, if a and b are boolean variables, then the logical expression a AND b translates to:
<Condition>
<And>
a
b
</And>
</Condition>
This means that anything between the start of And and end of And tag is logically connected with an AND. Similarly, the expression a OR b translates to:
<Condition>
<Or>
a
b
</Or>
</Condition>
The XML syntax described by the DTD allows nesting of conditions, hence a and b in the examples can be logical conditions. For example, expression (a AND b) OR (c AND d) translates to:
<Condition>
<Or>
<And>
a
b
</And>
<And>
c
d
</And>
</Or>
</Condition>
Anything between the start of Or and end of Or is logically ORed, hence the two expressions:
<And>
a
b
</And>
and
<And>
c
d
</And>
are ORed with one another. For a more complicated example, (( (a AND b) OR (c AND d) ) OR (e AND f)) AND (g OR h) is equivalent to the following:
<Condition>
<And>
<Or>
<Or>
<And>
a
b
</And>
<And>
c
d
</And>
</Or>
<And>
e
f
</And>
</Or>
<Or>
g
h
</Or>
</And>
</Condition>
Note that the DTD explicitly denies expressions of the form:
<Condition>
<Or>
<And>
a
b
</And>
c
</Or>
</Condition>
If c is a leaf condition, for example, one of IssueFieldCondition, ChangePackageFieldCondition or ChangePackageEntryFieldCondition). Leaf conditions must always be embedded between a start and end tag of a logical operator (either And or Or).