N1 Grid Service Provisioning System 5.0 XML Schema Reference Guide

<if> Step

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.


Example 2–1 Using the <if> Step

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>

<condition> Element

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.

<then> Element

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.

<else> Element

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.