Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromPlopix:3.4
Feb 7, 2018
Merged

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

fabpot merged 1 commit intosymfony:masterfromPlopix:3.4
Feb 7, 2018

Conversation

@Plopix
Copy link
Contributor

@PlopixPlopix commentedOct 27, 2017
edited
Loading

QA
Branch4.1
Bug fixno
New featureyes
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT
Doc PRsymfony/symfony-docs#9220

Hello,

workflow:dump exports workflows indot 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 aPHPStorm Plugin andplenty of integration of this format.

This PR adds 2 options

  • a--dump-format=puml option to theworkflow: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 withpull_request workflow of the documentation (with no style and no marking):

@startumltitle pull_requeststate start <<initial>>state codingstate travisstate reviewstate mergedstate closedstart --> travis: submitcoding --> travis: updatetravis --> travis: updatereview --> travis: updatetravis --> review: wait_for_reviewreview --> coding: request_changereview --> merged: acceptreview --> closed: rejectclosed --> 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:

@startumlsprite $sf_logo [81x20/16z] {hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsVyIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsXUnrujbYjjz0NnsObkTgnmolqJD4QgGUYTQiNe8eIjtx4b6Vv8nPGpncn3NJ8Geo9W9VW2wGACm_JzgIO8A8KXr2jUBCVGEAAJSZ6JUlsNnmOzmIYti9G7bjL8InaHM9G40NkwTG7OxrggvNIejA8AZuqyWjOzTIKi-wwYvjeHYesSWuPiTGDN5THzkYLU4MD5r2_0PDhG7LIUG33z5HtM6CP3icyWEVOS61sD_2ZsBfJdbVAqM53XHDUwhY0TAwPug3OG9NonRFhO8ynF3I4unuAMDHmSrXH57V1RGvl9jafuZF9ZhqjWOEh98y0tUYGsUxkBSllIyBdT2oM5Fn2-ut-fzsq_cQNuL6Uvwqrknh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2}title pull_requestskinparam titleBorderRoundCorner 15skinparam titleBorderThickness 2skinparam state {    BackgroundColor<<initial>> #87b741    BackgroundColor<<marked>> #3887C6    BorderColor #3887C6    BorderColor<<marked>> Black    FontColor<<marked>> White}state start <<initial>>state codingstate travis <<marked>>state review <<marked>>state mergedstate closedstart --> travis: submitcoding --> travis: updatetravis --> travis: updatereview --> travis: updatetravis --> review: wait_for_reviewreview --> coding: request_changereview --> merged: acceptreview --> closed: rejectclosed --> review: reopenfooter \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**@enduml

Which gives you that:
workflow

Withsquare as transition, it gives you that:
workflow

Hope you will find that interesting!

anaelChardan and chapterjason reacted with thumbs up emojichapterjason reacted with heart emoji
@Plopix
Copy link
ContributorAuthor

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!

CHANGELOG
=========

3.5.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It will be4.1.0 not3.5.0 (which never will be released)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok

}

return
'@startuml'.PHP_EOL.static::SYMFONY_LOGO.PHP_EOL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should be in previous line.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok


constMARKED ='marked';

constSYMFONY_LOGO ='sprite $sf_logo [81x20/16z] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think I got it and I made changes accordingly.

@nicolas-grekasnicolas-grekas added this to the4.1 milestoneOct 27, 2017
@nicolas-grekasnicolas-grekas changed the base branch from3.4 tomasterOctober 27, 2017 08:55
@Plopix
Copy link
ContributorAuthor

  • 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 currentworkflow: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.

anaelChardan reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

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

@lyrixx
Copy link
Member

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.

thrownew \InvalidArgumentException(sprintf('No service found for "workflow.%1$s" nor "state_machine.%1$s".',$serviceId));
}

/** @var \Symfony\Component\Workflow\Workflow $workflow */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like it's useless

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

not for PHPStorm ;) but I can remove it

@Plopix
Copy link
ContributorAuthor

@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
Copy link
Member

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

@nicolas-grekas
Copy link
Member

@lyrixx time to review? :)


publicfunction__construct($transitionType)
{
$this->transitionType =static::DEFAULT_TRANSITION_TYPE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why not using

protected$transitionType =self::DEFAULT_TRANSITION_TYPE;

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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 ;)

publicfunction__construct($transitionType)
{
$this->transitionType =static::DEFAULT_TRANSITION_TYPE;
if ($transitionType ==static::SQUARE_TRANSITION_TYPE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same as above comment


protectedfunctionisSquareTransitionType()
{
return$this->transitionType ==static::SQUARE_TRANSITION_TYPE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

why not=== ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok will change

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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 ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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 ;).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok

@Plopix
Copy link
ContributorAuthor

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.


publicfunction__construct($transitionType =null)
{
if ($transitionType ===static::SQUARE_TRANSITION_TYPE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

  • yoda style done.
  • it is a way to kind of enforcing the 2 types and those 2 type only the default one orsquare
    It would work without, but the value oftransitionType could be inconsistent. Let me know your thoughts


protectedfunctionisSquareTransitionType()
{
return$this->transitionType ===static::SQUARE_TRANSITION_TYPE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yoda style please.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think you need to count here

Copy link
ContributorAuthor

@PlopixPlopixDec 12, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

correct I replaced withis_array to ensure theforeach won't fail if someone send something else

Copy link
Contributor

@SimperfitSimperfit left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Some minor comments, but great improvment thanks !

@Plopix
Copy link
ContributorAuthor

updated@Simperfit (we are almost there ;) )

Copy link
Member

@lyrixxlyrixx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

useSymfony\Component\Workflow\Dumper\GraphvizDumper;
useSymfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
useSymfony\Component\Workflow\Marking;
useSymfony\Component\Console\Input\InputOption;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Input Option Is already imported.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

fixed.

useSymfony\Component\Workflow\Dumper\StateMachineGraphvizDumper;
useSymfony\Component\Workflow\Marking;
useSymfony\Component\Console\Input\InputOption;
useSymfony\Component\Workflow\Dumper\PlantUmlDumper;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could you sort alluses?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok

newInputArgument('marking', InputArgument::IS_ARRAY,'A marking (a list of places)'),
newInputOption('label','l', InputArgument::OPTIONAL,'Labels a graph'),
newInputOption('format',null, InputArgument::OPTIONAL,'The dump format','dot'),
newInputOption(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

alright, that is fixed.

newInputOption('label','l', InputArgument::OPTIONAL,'Labels a graph'),
newInputOption('format',null, InputArgument::OPTIONAL,'The dump format','dot'),
newInputOption(
'transition',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

puml_transition_format

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

fixed.

newInputOption(
'transition',
null,
InputArgument::OPTIONAL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is wrong:

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What is-p ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

newInputArgument('name', InputArgument::REQUIRED,'A workflow name'),
newInputArgument('marking', InputArgument::IS_ARRAY,'A marking (a list of places)'),
newInputOption('label','l', InputArgument::OPTIONAL,'Labels a graph'),
newInputOption('format',null, InputArgument::OPTIONAL,'The dump format','dot'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

"The dump format [dot|puml]"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

good catch I have renamed bydump_format


if ('puml' ===$format) {
$dumper =newPlantUmlDumper($transitionType);
}else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

use an else if here

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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/):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I suppose it does not generate a dot file.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

knh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2
}';
constINITIAL ='initial';
constMARKED ='marked';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn't some of these be private constants ?

lyrixx reacted with thumbs up emoji

privatefunctionisSquareTransitionType():bool
{
returnstatic::SQUARE_TRANSITION_TYPE ===$this->transitionType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

useself:: 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)

lyrixx reacted with thumbs up emoji
return$start;
}

return$start.static::SYMFONY_LOGO.PHP_EOL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

self: here as well

lyrixx reacted with thumbs up emoji
return$end;
}

returnPHP_EOL.'footer \nGenerated by <$sf_logo> **Workflow Component** and **PlantUML**'.$end;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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

@stof
Copy link
Member

The dump of the workflow in#24705 (comment) looks confusing to me. It looks like there are 2 independantpublish 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
Copy link
Member

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

@stof
Copy link
Member

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

@Plopix
Copy link
ContributorAuthor

Plopix commentedJan 23, 2018
edited
Loading

@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 onetransition 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 witharrow orsquare transition.
I have compared closely the dumps with Dot and PlantUML

On the cases provided in the doc and on thearticle 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 forcesquare forworkflow andarrow forstate_machine
  • 2/ we could put by defaultsquare forworkflow andarrow forstate_machine
  • 3/ don't do change anything as the user has the choice already

Let me know

@lyrixx
Copy link
Member

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

It's definitively the way to go ;)

@Plopix
Copy link
ContributorAuthor

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
Copy link
Member

2018-01-26 10 38 57

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

@Plopix
Copy link
ContributorAuthor

Plopix commentedJan 26, 2018
edited by lyrixx
Loading

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

@fabpot
Copy link
Member

Thank you@Plopix.

Plopix and bastnic reacted with hooray emoji

@fabpotfabpot merged commit1497d36 intosymfony:masterFeb 7, 2018
fabpot added a commit that referenced this pull requestFeb 7, 2018
…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 PRHello,`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 thatgenerates nicer diagrams, more readable and most of all easier to adapt to yourdocumentation. 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:```bashphp 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):```@startumltitle pull_requeststate start <<initial>>state codingstate travisstate reviewstate mergedstate closedstart --> travis: submitcoding --> travis: updatetravis --> travis: updatereview --> travis: updatetravis --> review: wait_for_reviewreview --> coding: request_changereview --> merged: acceptreview --> closed: rejectclosed --> review: reopen@enduml```As PlantUML let us define styles, I have provided some by default that the user can override.Adding some marking:```bashphp bin/console workflow:dump pull_request travis review --dump-format=puml```will give us:```@startumlsprite $sf_logo [81x20/16z] {hPNRaYiX24K1xwBo_tyx6-qaCtDEJ-KXLYMTLbp0HWcHZr3KRDJ8z94HG3jZn4_mijbQ2ryJoFePtXLWA_qxyGy19DpdY_10z11ZAbGjFHRwcEbcKx5-wqsVyIMo8StMCHKh8ZUxnEwrZiwRAUOvy1lLcPQF4lEFAjhzMd5WOAqvKflS0Enx8PbihiSYXM8ClGVAseIWTAjCgVSAcnYbQG79xKFsZ0VnDCNc7AVBoPSMcTsXUnrujbYjjz0NnsObkTgnmolqJD4QgGUYTQiNe8eIjtx4b6Vv8nPGpncn3NJ8Geo9W9VW2wGACm_JzgIO8A8KXr2jUBCVGEAAJSZ6JUlsNnmOzmIYti9G7bjL8InaHM9G40NkwTG7OxrggvNIejA8AZuqyWjOzTIKi-wwYvjeHYesSWuPiTGDN5THzkYLU4MD5r2_0PDhG7LIUG33z5HtM6CP3icyWEVOS61sD_2ZsBfJdbVAqM53XHDUwhY0TAwPug3OG9NonRFhO8ynF3I4unuAMDHmSrXH57V1RGvl9jafuZF9ZhqjWOEh98y0tUYGsUxkBSllIyBdT2oM5Fn2-ut-fzsq_cQNuL6Uvwqrknh4RrvOKzxZfLV3s0rs_R_1SdYt3VxeQ1_y2_W2}title pull_requestskinparam titleBorderRoundCorner 15skinparam titleBorderThickness 2skinparam state {    BackgroundColor<<initial>> #87b741    BackgroundColor<<marked>> #3887C6    BorderColor #3887C6    BorderColor<<marked>> Black    FontColor<<marked>> White}state start <<initial>>state codingstate travis <<marked>>state review <<marked>>state mergedstate closedstart --> travis: submitcoding --> travis: updatetravis --> travis: updatereview --> travis: updatetravis --> review: wait_for_reviewreview --> coding: request_changereview --> merged: acceptreview --> closed: rejectclosed --> review: reopenfooter \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
@PlopixPlopix deleted the 3.4 branchFebruary 7, 2018 07:28
@lyrixx
Copy link
Member

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

chapterjason reacted with thumbs up emoji

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestFeb 7, 2018
This PR was submitted for the 4.0 branch but it was merged into the master branch instead (closes#9220).Discussion----------[Workflow] PlantUML Dump documentationDocumentation related tosymfony/symfony#24705This 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.htmlCommits-------b62d961 [Workflow] PlantUML Dump documentation
@fabpotfabpot mentioned this pull requestMay 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof requested changes

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@lyrixxlyrixxlyrixx approved these changes

@NyholmNyholmNyholm approved these changes

+2 more reviewers

@stloydstloydstloyd left review comments

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

9 participants

@Plopix@nicolas-grekas@lyrixx@stof@fabpot@stloyd@Nyholm@Simperfit@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp