New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workflow] Add PlantUML dumper to workflow:dump command #24705

Merged
merged 1 commit into from Feb 7, 2018

Conversation

@Plopix
Contributor

Plopix commented Oct 27, 2017

Q A
Branch 4.1
Bug fix no
New feature yes
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT
Doc PR symfony/symfony-docs#9220

Hello,

workflow:dump exports workflows in dot format. To me, this format is not the easiest and not the simplest to use. Styles and logic are mixed together which makes it hard to read.

PlantUML is a tool based on Graphviz like Dot but that
generates nicer diagrams, more readable and most of all easier to adapt to your
documentation. Just copy and paste the PUML on the website you will see the rendering live.

Also, there is a PHPStorm Plugin and plenty of integration of this format.

This PR adds 2 options

  • a --dump-format=puml option to the workflow:dump command to generate the workflows in PlantUML.

The conversion requires the PlantUML JAR, and can be used like that:

php bin/console workflow:dump pull_request --dump-format=puml | java -jar plantuml.jar -p  > workflow.png

don't forget the -p to enable the "piping"

Here is an example with pull_request workflow of the documentation (with no style and no marking):

@startuml
title pull_request
state start <<initial>>
state coding
state travis
state review
state merged
state closed
start --> travis: submit
coding --> travis: update
travis --> travis: update
review --> travis: update
travis --> review: wait_for_review
review --> coding: request_change
review --> merged: accept
review --> closed: reject
closed --> review: reopen
@enduml

As PlantUML let us define styles, I have provided some by default that the user can override.
Adding some marking:

php bin/console workflow:dump pull_request travis review --dump-format=puml

will give us:

@startuml
sprite $sf_logo [81x20/16z] {
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
UnrujbYjjz0NnsObkTgnmolqJD4QgGUYTQiNe8eIjtx4b6Vv8nPGpncn3NJ8Geo9W9VW2wGACm_JzgIO8A8KXr2jUBCVGEAAJSZ6JUlsNnmOzmIYti9G7bjL
8InaHM9G40NkwTG7OxrggvNIejA8AZuqyWjOzTIKi-wwYvjeHYesSWuPiTGDN5THzkYLU4MD5r2_0PDhG7LIUG33z5HtM6CP3icyWEVOS61sD_2ZsBfJdbVA
qM53XHDUwhY0TAwPug3OG9NonRFhO8ynF3I4unuAMDHmSrXH57V1RGvl9jafuZF9ZhqjWOEh98y0tUYGsUxkBSllIyBdT2oM5Fn2-ut-fzsq_cQNuL6Uvwqr
knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
}
title pull_request
skinparam titleBorderRoundCorner 15
skinparam titleBorderThickness 2
skinparam state {
    BackgroundColor<<initial>> #87b741
    BackgroundColor<<marked>> #3887C6
    BorderColor #3887C6
    BorderColor<<marked>> Black
    FontColor<<marked>> White
}
state start <<initial>>
state coding
state travis <<marked>>
state review <<marked>>
state merged
state closed
start --> travis: submit
coding --> travis: update
travis --> travis: update
review --> travis: update
travis --> review: wait_for_review
review --> coding: request_change
review --> merged: accept
review --> closed: reject
closed --> review: reopen
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
@enduml

Which gives you that:
workflow

With square as transition, it gives you that:
workflow

Hope you will find that interesting!

@Plopix

This comment has been minimized.

Contributor

Plopix commented Oct 27, 2017

That is failing on Windows, but I don't really know why, probably a weird Windows specificity, or the END OF LINE?
You might have an idea?

Thanks!

@@ -1,6 +1,10 @@
CHANGELOG
=========
3.5.0

This comment has been minimized.

@stloyd

stloyd Oct 27, 2017

Contributor

It will be 4.1.0 not 3.5.0 (which never will be released)

This comment has been minimized.

@Plopix

Plopix Oct 27, 2017

Contributor

ok

}
return
'@startuml'.PHP_EOL.static::SYMFONY_LOGO.PHP_EOL;

This comment has been minimized.

@stloyd

stloyd Oct 27, 2017

Contributor

Should be in previous line.

This comment has been minimized.

@Plopix

Plopix Oct 27, 2017

Contributor

ok

const MARKED = 'marked';
const SYMFONY_LOGO = 'sprite $sf_logo [81x20/16z] {

This comment has been minimized.

@stloyd

stloyd Oct 27, 2017

Contributor

Better & probably safer than string comparison would be to save them as fixtures & compare results with pregenerated fixture.

This comment has been minimized.

@Plopix

Plopix Oct 27, 2017

Contributor

I am not sure I understand here what you are proposing. Can you tell me more and I will be happy to change.

This comment has been minimized.

@Plopix

Plopix Oct 28, 2017

Contributor

I think I got it and I made changes accordingly.

@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Oct 27, 2017

@nicolas-grekas nicolas-grekas changed the base branch from 3.4 to master Oct 27, 2017

@Plopix

This comment has been minimized.

Contributor

Plopix commented Oct 28, 2017

  • I fixed the comment 9 (cc @stloyd)
  • appveyor build is passing now
  • travis-ci build fails because of VarDumper (that is not related to this PR cc @nicolas-grekas)

@Nyholm or @lyrixx
Question/Note: The current workflow:dump does not generate the same way workflow and state machine. Is that a standard? I feel that it is so much more readable with transition names on the arrows. Is that something you want me to add on the PR? I am not a graph expert and it might be a convention or something.

@nicolas-grekas

This comment has been minimized.

Member

nicolas-grekas commented Oct 28, 2017

DST time, transient failure will be fixed tomorrow hopefully :)

@lyrixx

This comment has been minimized.

Member

lyrixx commented Nov 7, 2017

Question/Note: The current workflow:dump does not generate the same way workflow and state machine. Is that a standard?

Oups Sorry I forgot to reply.

Yes it's wanted. As a state machine can have many transition with the same name, the graph could be very ugly. that's why we did this.

} else {
throw new \InvalidArgumentException(sprintf('No service found for "workflow.%1$s" nor "state_machine.%1$s".', $serviceId));
}
/** @var \Symfony\Component\Workflow\Workflow $workflow */

This comment has been minimized.

@lyrixx

lyrixx Nov 7, 2017

Member

Looks like it's useless

This comment has been minimized.

@Plopix

Plopix Nov 8, 2017

Contributor

not for PHPStorm ;) but I can remove it

@Plopix

This comment has been minimized.

Contributor

Plopix commented Nov 8, 2017

@lyrixx I have added an option to let the user decide which transition he wants.
I hope that is fine for you! Because to me, the square as transition kind of complexify sometimes too. It is great to have the option.

@lyrixx

This comment has been minimized.

Member

lyrixx commented Nov 8, 2017

Thanks. I will try your PR as soon as possible ;)

@nicolas-grekas

This comment has been minimized.

Member

nicolas-grekas commented Dec 8, 2017

@lyrixx time to review? :)

public function __construct($transitionType)
{
$this->transitionType = static::DEFAULT_TRANSITION_TYPE;

This comment has been minimized.

@Simperfit

Simperfit Dec 9, 2017

Contributor

You don't need to do this since it's already defaulted when you do $input->getOption('transition')

This comment has been minimized.

@Plopix

Plopix Dec 10, 2017

Contributor

I agree but this class could be used differently and without the command then I think it is correct to initialize it. no?

This comment has been minimized.

@Simperfit

Simperfit Dec 11, 2017

Contributor

Why not using

protected $transitionType = self::DEFAULT_TRANSITION_TYPE;

instead ?
I may be missing something but it feels better to me.

This comment has been minimized.

@Plopix

Plopix Dec 12, 2017

Contributor

No that is me, I don't know I wanted to avoid that because of php versions but now for 4.x it is php 7 then we are all good to do that. And I think we were good before too...I was wrong. It is better now ;)

public function __construct($transitionType)
{
$this->transitionType = static::DEFAULT_TRANSITION_TYPE;
if ($transitionType == static::SQUARE_TRANSITION_TYPE) {

This comment has been minimized.

@Simperfit

Simperfit Dec 9, 2017

Contributor
if (static::SQUARE_TRANSITION_TYPE === $transitionType)

This comment has been minimized.

@Plopix

Plopix Dec 10, 2017

Contributor

same as above comment

protected function isSquareTransitionType()
{
return $this->transitionType == static::SQUARE_TRANSITION_TYPE;

This comment has been minimized.

@Simperfit

Simperfit Dec 9, 2017

Contributor

why not === ?

This comment has been minimized.

@Plopix

Plopix Dec 10, 2017

Contributor

ok will change

$code[] = "agent {$transition->getName()}";
}
}
foreach ($definition->getTransitions() as $transition) {

This comment has been minimized.

@Simperfit

Simperfit Dec 9, 2017

Contributor

It feels like alot of complexity comparing to the GraphvizDumper, isn't in the class something you could re-use to get arrays and then transform them directly ?

This comment has been minimized.

@Plopix

Plopix Dec 10, 2017

Contributor

Not really sure I get what you want me to do. I agree it is not really straightforward but it is an efficient way to manage both TransitionType, GraphvizDumper as 2 classes to do that. I did not see the value for the PlantUML one, and I still don't see it. (but I would love to have your opinion)

I could do that in another method and then merge arrays... is it what you would like?.

Let me know!

Thank you!

This comment has been minimized.

@Simperfit

Simperfit Dec 11, 2017

Contributor

I was just thinking on how much this adds complexity. I guess if merging the arrays cost more in performance than what you are doing here let's keep this. (I think it will be anyway).

I just wanted to know more about this ;).

This comment has been minimized.

@Plopix

Plopix Dec 12, 2017

Contributor

ok

@Plopix

This comment has been minimized.

Contributor

Plopix commented Dec 12, 2017

I have updated the PR and rebased. Not sure why the tests are failing I think it is not related to this code, master code is failing too.

public function __construct($transitionType = null)
{
if ($transitionType === static::SQUARE_TRANSITION_TYPE) {

This comment has been minimized.

@Simperfit

Simperfit Dec 12, 2017

Contributor

You should use yoda style, btw I don't know if it's really needed to do this

This comment has been minimized.

@Plopix

Plopix Dec 12, 2017

Contributor
  • yoda style done.
  • it is a way to kind of enforcing the 2 types and those 2 type only the default one or square
    It would work without, but the value of transitionType could be inconsistent. Let me know your thoughts
protected function isSquareTransitionType()
{
return $this->transitionType === static::SQUARE_TRANSITION_TYPE;

This comment has been minimized.

@Simperfit

Simperfit Dec 12, 2017

Contributor

yoda style please.

This comment has been minimized.

@Plopix

Plopix Dec 12, 2017

Contributor

done

if (isset($options['name'])) {
$code[] = "title {$options['name']}";
}
if (isset($options['skinparams']) && count($options['skinparams']) > 0) {

This comment has been minimized.

@Simperfit

Simperfit Dec 12, 2017

Contributor

I don't think you need to count here

This comment has been minimized.

@Plopix

Plopix Dec 12, 2017

Contributor

correct I replaced with is_array to ensure the foreach won't fail if someone send something else

@Simperfit

Simperfit approved these changes Dec 12, 2017 edited

Some minor comments, but great improvment thanks !

@Plopix

This comment has been minimized.

Contributor

Plopix commented Dec 12, 2017

updated @Simperfit (we are almost there ;) )

@lyrixx

I let few comments on the Command Class. It seems you did not test it on real
project :/

And I followed you doc and it does not work. the program open a dialog windows
where I'm supposed to select a folder. I'm a bit lost.

Finally, I'm not sure if plantuml is really mainstream. By default the website
is in French :/ http://plantuml.com/

So for now I'm not sure we want this support in the Core. What do others think?

ping @xabbuh @Nyholm

@@ -19,6 +19,8 @@
use Symfony\Component\Workflow\Dumper\GraphvizDumper;
use Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Console\Input\InputOption;

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

Input Option Is already imported.

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

fixed.

@@ -19,6 +19,8 @@
use Symfony\Component\Workflow\Dumper\GraphvizDumper;
use Symfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
use Symfony\Component\Workflow\Marking;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Workflow\Dumper\PlantUmlDumper;

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

Could you sort all uses?

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

ok

@@ -39,13 +41,23 @@ protected function configure()
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'),
new InputOption('format', null, InputArgument::OPTIONAL, 'The dump format', 'dot'),
new InputOption(

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

We don't do that in Symfony. All arguments should be on one line..

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

alright, that is fixed.

@@ -39,13 +41,23 @@ protected function configure()
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'),
new InputOption('format', null, InputArgument::OPTIONAL, 'The dump format', 'dot'),
new InputOption(
'transition',

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

puml_transition_format

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

fixed.

new InputOption(
'transition',
null,
InputArgument::OPTIONAL,

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

This is wrong:

  • It's an option, not an arguement
  • The value is required

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

correct, fixed.

%command.full_name% <workflow name> | dot -Tpng > workflow.png
<info>DOT</info>: %command.full_name% <workflow name> | dot -Tpng > workflow.png
<info>PUML</info>: %command.full_name% <workflow name> --format=puml -p | java -jar plantuml.jar > workflow.png

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

What is -p ?

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

That is a typo (not present in the PR doc) the -p, as mentioned in the PR doc is for piping. But it is for plantuml.jar... not for the command. I have fixed that too.

@@ -39,13 +41,23 @@ protected function configure()
new InputArgument('name', InputArgument::REQUIRED, 'A workflow name'),
new InputArgument('marking', InputArgument::IS_ARRAY, 'A marking (a list of places)'),
new InputOption('label', 'l', InputArgument::OPTIONAL, 'Labels a graph'),
new InputOption('format', null, InputArgument::OPTIONAL, 'The dump format', 'dot'),

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

"The dump format [dot|puml]"

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

format is a bad name because it's already used in the --help command.
So bin/console workflow:dump article --format=puml -h do not work anymore

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

good catch I have renamed by dump_format

} else {
throw new \InvalidArgumentException(sprintf('No service found for "workflow.%1$s" nor "state_machine.%1$s".', $serviceId));
}
if ('puml' === $format) {
$dumper = new PlantUmlDumper($transitionType);
} else {

This comment has been minimized.

@lyrixx

lyrixx Dec 27, 2017

Member

use an else if here

This comment has been minimized.

@Plopix

Plopix Dec 28, 2017

Contributor

ok done.

/**
* PlantUmlDumper dumps a workflow as a PlantUML file.
*
* You can convert the generated dot file with the plantuml.jar utility (http://plantuml.com/):

This comment has been minimized.

@fabpot

fabpot Jan 23, 2018

Member

I suppose it does not generate a dot file.

This comment has been minimized.

@Plopix

Plopix Jan 23, 2018

Contributor

that is correct, I have pushed the correction. thx!

@lyrixx

lyrixx approved these changes Jan 23, 2018

@Nyholm

Nyholm approved these changes Jan 23, 2018

@fabpot

fabpot approved these changes Jan 23, 2018

knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
}';
const INITIAL = 'initial';
const MARKED = 'marked';

This comment has been minimized.

@stof

stof Jan 23, 2018

Member

shouldn't some of these be private constants ?

private function isSquareTransitionType(): bool
{
return static::SQUARE_TRANSITION_TYPE === $this->transitionType;

This comment has been minimized.

@stof

stof Jan 23, 2018

Member

use self:: to access constant. There is no reason to make them an extension point by allowing changing their values (and the code would not work anyway in such case, due to other places)

return $start;
}
return $start.static::SYMFONY_LOGO.PHP_EOL;

This comment has been minimized.

@stof

stof Jan 23, 2018

Member

self: here as well

return $end;
}
return PHP_EOL.'footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**'.$end;

This comment has been minimized.

@stof

stof Jan 23, 2018

Member

Are you sure about the \n here, which is not a newline char ?

This comment has been minimized.

@Plopix

Plopix Jan 23, 2018

Contributor

yes I think so, the \n is working as expected.

@stof

This comment has been minimized.

Member

stof commented Jan 23, 2018

The dump of the workflow in #24705 (comment) looks confusing to me. It looks like there are 2 independant publish transitions, allowing to go one path or the other, while it is actually a single transition with 2 inputs (meaning that it is a AND between both paths, not a OR). This is exactly the reason why the dot dumper uses boxes to represent transitions, not arrows (to allow having multiple inputs and multiple outputs for each of them).
This is the main difference between a generic workflow and a state machine (the state machine has only one input and one output for each transition)

@lyrixx

This comment has been minimized.

Member

lyrixx commented Jan 23, 2018

Oh @stof Is totally right. This PR could not be merged in this state.

@stof

This comment has been minimized.

Member

stof commented Jan 23, 2018

The current dumper is fine for the case of state machines though

@Plopix

This comment has been minimized.

Contributor

Plopix commented Jan 23, 2018

@stof thank you I have updated the code.
About the confusion, well as I said before, I am not an expert on workflow/state_machine, I was just trying to provide a better dump.

From my point of view, I don't find it that confusing as I know that I can have only one transition with the same name, then it must be the same.

You said:

This is the main difference between a generic workflow and a state machine (the state machine has only one input and one output for each transition)

But here: https://symfony.com/doc/current/workflow/state-machines.html
update gets multiple 'from'

The PR is aiming to let the choice to the user to dump it with arrow or square transition.
I have compared closely the dumps with Dot and PlantUML

On the cases provided in the doc and on the article workflow of @lyrixx :
(for each I dumped with Dot, PlantUML square and arrow transition)

Pull Request: https://symfony.com/doc/current/workflow/state-machines.html
screen shot 2018-01-23 at 1 46 31 pm

Blog Publishing: https://symfony.com/doc/current/workflow/usage.html
screen shot 2018-01-23 at 1 49 20 pm

Article: https://github.com/lyrixx/SFLive-Paris2016-Workflow/blob/master/config/packages/workflow.yaml#L3
screen shot 2018-01-23 at 1 51 03 pm

I think that is working, I am not sure what you are expecting, I see at least 3 options in which we could go:

  • 1/ we could force square for workflow and arrow for state_machine
  • 2/ we could put by default square for workflow and arrow for state_machine
  • 3/ don't do change anything as the user has the choice already

Let me know

@lyrixx

This comment has been minimized.

Member

lyrixx commented Jan 24, 2018

1/ we could force square for workflow and arrow for state_machine

It's definitively the way to go ;)

@Plopix

This comment has been minimized.

Contributor

Plopix commented Jan 25, 2018

hey @lyrixx @stof I have done the option 1/

For the sake of my understanding, I would love if you could you explain why "arrows" are not valid sometimes?
screen shot 2018-01-25 at 12 07 02 am

In this example, for instance, it feels simpler to have arrows. But I would understand if the reason is to force a kind of consistency for each type.

Let me know!

@lyrixx

This comment has been minimized.

Member

lyrixx commented Jan 26, 2018

2018-01-26 10 38 57

As you can see on the previous schema, If you don't draw the transition (square), you have no way to know how many transition there are. And of course the 2 workflows (line 1 and line 2) are totally different.

@Plopix

This comment has been minimized.

Contributor

Plopix commented Jan 26, 2018

ok makes sense ;-) all good to merge then maybe ;-)

@fabpot

fabpot approved these changes Feb 7, 2018

@fabpot

This comment has been minimized.

Member

fabpot commented Feb 7, 2018

Thank you @Plopix.

@fabpot fabpot merged commit 1497d36 into symfony:master Feb 7, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Feb 7, 2018

feature #24705 [Workflow] Add PlantUML dumper to workflow:dump comman…
…d (Plopix)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[Workflow] Add PlantUML dumper to workflow:dump command

| Q             | A
| ------------- | ---
| Branch        | 4.1
| Bug fix       | no
| New feature   | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | Will do depending on the comments about that PR

Hello,

`workflow:dump` exports workflows in `dot` format. To me, this format is not the easiest and not the simplest to use. Styles and logic are mixed together which makes it hard to read.

[PlantUML](http://plantuml.com/) is a tool based on Graphviz like Dot but that
generates nicer diagrams, more readable and most of all easier to adapt to your
documentation. Just copy and paste the PUML on the website you will see the rendering live.

Also, there is a [PHPStorm Plugin](https://plugins.jetbrains.com/plugin/7017-plantuml-integration) and [plenty of integration](http://plantuml.com/running) of this format.

This PR adds 2 options

* a `--dump-format=puml` option to the `workflow:dump` command to generate the workflows in PlantUML.

* a `--puml-transition-format=square|arrow` option to the `workflow:dump` command to generate the workflows in PlantUML using a square shape or arrow for the transition. (see below)

The conversion requires the PlantUML JAR, and can be used like that:
```bash
php bin/console workflow:dump pull_request --dump-format=puml | java -jar plantuml.jar -p  > workflow.png
```
> don't forget the `-p` to enable the "piping"

Here is an example with `pull_request` workflow of the documentation (with no style and no marking):
```
@startuml
title pull_request
state start <<initial>>
state coding
state travis
state review
state merged
state closed
start --> travis: submit
coding --> travis: update
travis --> travis: update
review --> travis: update
travis --> review: wait_for_review
review --> coding: request_change
review --> merged: accept
review --> closed: reject
closed --> review: reopen
@enduml
```

As PlantUML let us define styles, I have provided some by default that the user can override.
Adding some marking:
```bash
php bin/console workflow:dump pull_request travis review --dump-format=puml
```
will give us:

```
@startuml
sprite $sf_logo [81x20/16z] {
hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsV
yIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsX
UnrujbYjjz0NnsObkTgnmolqJD4QgGUYTQiNe8eIjtx4b6Vv8nPGpncn3NJ8Geo9W9VW2wGACm_JzgIO8A8KXr2jUBCVGEAAJSZ6JUlsNnmOzmIYti9G7bjL
8InaHM9G40NkwTG7OxrggvNIejA8AZuqyWjOzTIKi-wwYvjeHYesSWuPiTGDN5THzkYLU4MD5r2_0PDhG7LIUG33z5HtM6CP3icyWEVOS61sD_2ZsBfJdbVA
qM53XHDUwhY0TAwPug3OG9NonRFhO8ynF3I4unuAMDHmSrXH57V1RGvl9jafuZF9ZhqjWOEh98y0tUYGsUxkBSllIyBdT2oM5Fn2-ut-fzsq_cQNuL6Uvwqr
knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
}
title pull_request
skinparam titleBorderRoundCorner 15
skinparam titleBorderThickness 2
skinparam state {
    BackgroundColor<<initial>> #87b741
    BackgroundColor<<marked>> #3887C6
    BorderColor #3887C6
    BorderColor<<marked>> Black
    FontColor<<marked>> White
}
state start <<initial>>
state coding
state travis <<marked>>
state review <<marked>>
state merged
state closed
start --> travis: submit
coding --> travis: update
travis --> travis: update
review --> travis: update
travis --> review: wait_for_review
review --> coding: request_change
review --> merged: accept
review --> closed: reject
closed --> review: reopen
footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**
@enduml
```

Which gives you that:
![workflow](https://user-images.githubusercontent.com/313532/32086584-253e39c0-ba8b-11e7-82c7-fa24309dbcd6.png)

With `square` as transition, it gives you that:
![workflow](https://user-images.githubusercontent.com/313532/32533123-a8ea4530-c403-11e7-8f88-4f18d5e23a28.png)

Hope you will find that interesting!

Commits
-------

1497d36 Add option to the workflow:dump command to allow PlantUML format dump

@Plopix Plopix deleted the Plopix:3.4 branch Feb 7, 2018

@lyrixx

This comment has been minimized.

Member

lyrixx commented Feb 7, 2018

👏 Thanks for your hard work on this feature. I just tested it and it works very well.

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Feb 7, 2018

minor #9220 [Workflow] PlantUML Dump documentation (Plopix)
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

@fabpot fabpot referenced this pull request May 7, 2018

Merged

Release v4.1.0-BETA1 #27181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment