Moab Viewpoint
Boolean Deciders

Boolean Deciders

Whenever the XML allows a boolean decider (instead of a concrete boolean), these are the valid options:

  • A comparison operation between two values.
  • A logical operation (OR or AND).
  • A concrete boolean value (either "true" or "false") inside the parent element.
  • A checkbox component (such as <component id="nameOfCheckbox" />) inside the parent element.

Comparison Operation

A comparison can compare dates or strings. Whenever a boolean decider is expected in the XML, the comparison attribute can be added, with a value of:

  • "equal" - Evaluates to true only if the first and second values are equal.
  • "lessthan" - Evaluates to true only if the first is less than the second.
  • "greaterthan" - Evaluates to true only if the first is greater than the second.
  • "not" - Evaluates to true only if the first is NOT equal to the second.

A comparison requires an attribute type which must be "string" or "date". If unknown or missing, Viewpoint assumes "string".

All comparison operations require <first> and <second> elements (which themselves could be deciders). The type of decider is dependent on the type attribute. If the type is "string" the first and second values should be string deciders. If the type is "date", the first and second values should be date deciders.

In the example below, the requirement evaluates to true if the value in the "procs" component is equal to "1".

<requirement comparison="equals">
 <first>
  <component id="procs" />
 </first>
 <second>1</second>
</requirement>

Logical Operation

A logical operation decider takes any number of children boolean operation deciders and performs a logical operation to determine the final boolean value. The two types of logical operations are:

  • "or" - Perform a logical OR operation. If any child element evaluates to true the operation evaluates to true.
  • "and" - Perform a logical AND operation. If all child elements evaluates to true the operation evaluates to true.

To specify the type of logical operation, use the logical-operation attribute with one of the above values. All logical operations require at least two children.

In the example below, the requirement is evaluated to true if either the "test_vlan" or "dev_vlan" components are true.

<requirement logical-operation="or">
 <value>
  <component id="test_vlan" />
 </value>
 <value>
  <component id="dev_vlan" />
 </value>
</requirement>