This step is used to conditionally execute a block of steps. This step has no attributes. Its child elements are <condition>, <then>, and <else>. The <condition> and <then> elements must appear one time. If you specify the <else> element, it can only appear one time.
If the contents of the <condition> element evaluates to true, the steps of the <then> block are executed. Otherwise, the steps of the <else> block are executed, if present.
The following example shows an <if> step that is used to conditionally restart.
<if> <condition><istrue value=":[restart]"/></condition> <then> <call blockName="restart"/> </then> </if> |
The <condition> element is a child of the <if> step and specifies a Boolean expression. This element has no attributes and must contain exactly one Boolean operator child element. See Boolean Operators.
The <then> element is a child element of the <if> step. This element specifies the steps to execute if the associated condition is true. The <then> element can contain any number of steps that are permitted within the scope of the block that contains the <if> step.
The <else> element is a child element of the <if> step. This element specifies the steps to execute if the associated condition is not true. The <else> element can contain any number of steps that are permitted within the scope of the block that contains the <if> step.