state:if

Description

This job implements an if/then/else logic. This job can contain any number of child jobs. The first job is taken to be the condition. If the resulting state matches the given state the second job is executed. If it doesn't then the third job is executed, (if it exists).

The completion state is that of the then or else job. If either don't exist then the Job is flagged as complete.

If any more than three jobs are provided the extra jobs are ignored.

Properties

NameDescriptionRequired
name A name, can be any text. No.
state The state to check against. No, defaults to COMPLETE.
not Not the state. No, defaults to false.

Elements

jobs

Required: At least one.

The child jobs.

Example

 <state:if xmlns:state="http://rgordon.co.uk/oddjob/state" 
              name="If A File Exists">
   <jobs>
      <exists file="some.txt"/>
      <echo text="File Exists"/>
      <echo text="File Doesn't Exist"/>
   </jobs>
 </state:if>
 


(c) Rob Gordon 2005 - 2009