@@ -5,31 +5,56 @@ How to Dump Workflows
55=====================
66
77To help you debug your workflows, you can dump a representation of your workflow
8- with the use of a ``DumperInterface ``.Use the `` GraphvizDumper `` to create a
9- PNG image of the workflow defined above::
8+ or state machine with the use of a ``DumperInterface ``.Symfony provides 2
9+ different dumpers both based on Dot.
1010
11- // dump-graph.php
11+ Use the ``GraphvizDumper `` or ``StateMachineGraphvizDumper `` to create DOT
12+ files, or use ``PlantUmlDumper `` for PlantUML files. Both types can be converted
13+ to PNG images.
14+
15+ Images of the workflow defined above:
16+
17+ ..code-block ::php
18+
19+ // dump-graph-dot.php
1220 $dumper = new GraphvizDumper();
1321 echo $dumper->dump($definition);
1422
23+ ..code-block ::php
24+
25+ // dump-graph-puml.php
26+ $dumper = new PlantUmlDumper();
27+ echo $dumper->dump($definition);
28+
1529 ..code-block ::terminal
1630
17- $ php dump-graph.php | dot -Tpng -o graph.png
31+ $ php dump-graph-dot.php | dot -Tpng -o dot_graph.png
32+ $ php dump-graph-puml.php | java -jar plantuml.jar -p > puml_graph.png
1833
19- The result will look like this:
34+ TheDOT result will look like this:
2035
2136..image ::/_images/components/workflow/blogpost.png
2237
23- Inside a Symfony application, you can dump the dot file with the
38+ The PUML result:
39+
40+ ..image ::/_images/components/workflow/blogpost_puml.png
41+
42+ Inside a Symfony application, you can dump the files with those commands using
2443``workflow:dump `` command:
2544
2645..code-block ::terminal
2746
2847 $ php bin/console workflow:dump name | dot -Tpng -o graph.png
48+ $ php bin/console workflow:dump name --dump-format=puml | java -jar plantuml.jar -p > workflow.png
2949
3050 ..note ::
3151
3252 The ``dot `` command is part of Graphviz. You can download it and read
3353 more about it on `Graphviz.org `_.
3454
55+ The ``plantuml.jar `` command is part of PlantUML. You can download it and
56+ read more about it on `PlantUML.com `_.
57+
58+
3559.. _Graphviz.org :http://www.graphviz.org
60+ .. _PlantUML.com :http://plantuml.com/