Graph Task
Description
The graph task is a utility task used to construct an encoded state graph description as a reusable artifact.
Attributes
| dest | Optional attribute used to override the output file. If not declared the task will produce a deliverable artifact of of the type state containing an XML encoded state graph. |
Nested Elements
| trigger | An initialization or termination trigger. |
| state | A nested state. |
| transition | A state transition. |
| operation | A management operation. |
Example
<project name="standalone-graph-example" default="install"
xmlns:transit="antlib:dpml.tools.transit"
xmlns:x="dpml:depot"
xmlns:c="dpml:metro">
<transit:import uri="local:template:dpml/depot/standard"/>
<target name="build" depends="standard.build">
<x:plugin uri="link:plugin:dpml/metro/dpml-metro-tools"/>
<c:graph>
<trigger event="initialization">
<transition name="startup" target="started">
<operation method="start"/>
</transition>
</trigger>
<state name="started">
<trigger event="termination">
<apply id="stop"/>
</trigger>
<transition name="stop" target="../stopped">
<operation method="stop"/>
</transition>
</state>
<state name="stopped">
<transition name="start" target="../started">
<operation method="start"/>
</transition>
</state>
</c:graph>
</target>
</project>