Skip to content

Commit

Permalink
minor #9220 [Workflow] PlantUML Dump documentation (Plopix)
Browse files Browse the repository at this point in the history
This PR was submitted for the 4.0 branch but it was merged into the master branch instead (closes #9220).

Discussion
----------

[Workflow] PlantUML Dump documentation

Documentation related to symfony/symfony#24705
This PR aims to explain that the PlantUML dump format is available.

Platform.sh URL: http://pr-9220-x7nzdnq-6qmocelev2lwe.eu.platform.sh/workflow/dumping-workflows.html

Commits
-------

b62d961 [Workflow] PlantUML Dump documentation
  • Loading branch information
javiereguiluz committed Feb 7, 2018
2 parents 951cb87 + b62d961 commit 30fdd17
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
Binary file added _images/components/workflow/blogpost_puml.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 31 additions & 6 deletions workflow/dumping-workflows.rst
Expand Up @@ -5,31 +5,56 @@ How to Dump Workflows
=====================

To help you debug your workflows, you can dump a representation of your workflow
with the use of a ``DumperInterface``. Use the ``GraphvizDumper`` to create a
PNG image of the workflow defined above::
or state machine with the use of a ``DumperInterface``. Symfony provides 2
different dumpers both based on Dot.

// dump-graph.php
Use the ``GraphvizDumper`` or ``StateMachineGraphvizDumper`` to create DOT
files, or use ``PlantUmlDumper`` for PlantUML files. Both types can be converted
to PNG images.

Images of the workflow defined above:

.. code-block:: php
// dump-graph-dot.php
$dumper = new GraphvizDumper();
echo $dumper->dump($definition);
.. code-block:: php
// dump-graph-puml.php
$dumper = new PlantUmlDumper();
echo $dumper->dump($definition);
.. code-block:: terminal
$ php dump-graph.php | dot -Tpng -o graph.png
$ php dump-graph-dot.php | dot -Tpng -o dot_graph.png
$ php dump-graph-puml.php | java -jar plantuml.jar -p > puml_graph.png
The result will look like this:
The DOT result will look like this:

.. image:: /_images/components/workflow/blogpost.png

Inside a Symfony application, you can dump the dot file with the
The PUML result:

.. image:: /_images/components/workflow/blogpost_puml.png

Inside a Symfony application, you can dump the files with those commands using
``workflow:dump`` command:

.. code-block:: terminal
$ php bin/console workflow:dump name | dot -Tpng -o graph.png
$ php bin/console workflow:dump name --dump-format=puml | java -jar plantuml.jar -p > workflow.png
.. note::

The ``dot`` command is part of Graphviz. You can download it and read
more about it on `Graphviz.org`_.

The ``plantuml.jar`` command is part of PlantUML. You can download it and
read more about it on `PlantUML.com`_.


.. _Graphviz.org: http://www.graphviz.org
.. _PlantUML.com: http://plantuml.com/

0 comments on commit 30fdd17

Please sign in to comment.