Document toolboxDocument toolbox

Expression Attributes and Matching

Two types of Raw XML Editor elements may have an "Expression" attribute:

  • PolicyRuleLogic

  • SetFilter

An expression attribute is a shorthand method of creating complex Boolean expressions based upon other elements. An expression attribute may consist of integers, parentheses, 'and', 'or', 'if', 'then', and 'else'. The numbers should refer to direct child elements, that in turn must include label attributes matching the numbers. For example, the following <PolicyRuleLogic> element shows three child elements 1, 2 and 3:

<PolicyRuleLogic expression='(1 and 2) or 3'>
   <Expr label='1' field='RoutingInd'/>
   <Expr label='2' field='SwitchingInd'/>
   <Expr label='3' op='='>
    <Expr field='DeviceType'/>
    <Expr value='Switch-Router'/>
   </Expr>
</PolicyRuleLogic>

will pass any Device that has either both its RoutingInd AND SwitchingInd set to true (note the logical AND), or has a DeviceType of 'Switch-Router'. For <PolicyRuleLogic> elements, any device matching the criteria passes the rule, and devices that do not match it will fail the rule.