6.6. WhileAction (structured action)

<whileAction> ‐ A conditional loop of structured actions

6.6.1. Attributes

NameTypeDefaults
delayFLOAT0.0
value1FLOATNone (required)
value2FLOATNone (required)
bool_operatorSTRING==

6.6.2. Description

The whileAction element is used to control the execution a sequence of structured actions.

The float value of the value1 and value2 attributes define the condition under which the embraced actions are executed. The value Op of the string attribute bool_operator defines the value comparison operator: ==, <=, <, >=, >, or !=. The execution of the sequence of operations in the whileAction element is performed as long as the result of the boolean comparison value1 Op value2 is true.

6.6.3. Expected children

A sequence of structured actions: action, repeatAction, whileAction, or ifAction elements.

6.6.4. Example

The following example is a whileAction executed as long as the variables initialSite and initialSite of the node birdPath {#n} have the same values:

<whileAction value1="({$birdPath {#n}:initialSite})" 
             value2="({$birdPath {#n}:finalSite})" operator="==">
  <action>
    <set_node_scalar_value id="finalSite"
            value="(rand(1,({#nbBirds}+0.9999)))" operator="="/>
    <target type="single_node" value="#birdPath {#n}" />
  </action>
</whileAction>