State MachineOne of the building blocks of the BlackBadger system is the notion of a state machine. This state machine breaks up the execution of the overall system into discrete stages or states. The rules of the state machine are quite simple:
BlackBadger will execute the state of each agent in parallel. The agent in turn will execute that particular state for each of the components it is managing. A state in reality is just an ANT target. This target will execute within the ANT runtime and if for any reason it does not exit cleanly that will deem the state to have failed, which in turn fails the whole state machine. You can specify any number of states for your state machine in the main system XML file. For example, consider the example below, this defines 5 states, state1/state2/state3/state4 with the last one called laststate. In each of the component xml files you would need to provide ANT targets for each of the states you wanted to execute. <system name="sample file"> <states order="state1,state2,state3,state4,laststate"/> <system> The underlying component XML file does not have to provide an ANT target for all the states; only the ones that it is interested in providing an execution for. If a state does not exist then it is assumed to have completed successfully. A missing state will not fail the state machine. There are 5 default states defined should you opt to not supply or add your own.
State names are case-sensitive. To avoid confusion, keep them all lower case. |