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] Fixed dumping when many transition with same name exist#31331

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:3.4fromlyrixx:workflow-dump
May 1, 2019

Conversation

@lyrixx
Copy link
Member

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no>
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

With this configuration:

framework:workflows:foobar:type:workflowsupports:                -stdClassinitial_place:aplaces:                -a                -b                -c                -cancelledtransitions:                -name:a-bfrom:ato:b                -name:b-cfrom:bto:c                -name:cancelfrom:ato:cancelled                -name:cancelfrom:bto:cancelled                -name:cancelfrom:cto:cancelled

before:
workflow-broken

After:
workflow-fixed

@lyrixx
Copy link
MemberAuthor

Failure are not related

@fabpot
Copy link
Member

Thank you@lyrixx.

@fabpotfabpot merged commit312a456 intosymfony:3.4May 1, 2019
fabpot added a commit that referenced this pull requestMay 1, 2019
…me exist (lyrixx)This PR was merged into the 3.4 branch.Discussion----------[Workflow] Fixed dumping when many transition with same name exist| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no>| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |---With this configuration:```yamlframework:    workflows:        foobar:            type: workflow            supports:                - stdClass            initial_place: a            places:                - a                - b                - c                - cancelled            transitions:                -   name: a-b                    from: a                    to: b                -   name: b-c                    from: b                    to: c                -   name: cancel                    from: a                    to: cancelled                -   name: cancel                    from: b                    to: cancelled                -   name: cancel                    from: c                    to: cancelled```before:![workflow-broken](https://user-images.githubusercontent.com/408368/56969037-a0315500-6b64-11e9-917e-4c45820938cc.png)After:![workflow-fixed](https://user-images.githubusercontent.com/408368/56969047-a4f60900-6b64-11e9-8f07-30e701a4978f.png)Commits-------312a456 [Workflow] Fixed dumping when many transition with same name exist
foreach ($transitionsas$place) {
$code .=sprintf(" transition_%s [label=\"%s\", shape=box%s];\n",$this->dotize($place['name']),$place['name'],$this->addAttributes($place['attributes']));
foreach ($transitionsas$i =>$place) {
$code .=sprintf(" transition_%d [label=\"%s\", shape=box%s];\n",$this->dotize($i),$place['name'],$this->addAttributes($place['attributes']));
Copy link
Member

Choose a reason for hiding this comment

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

@lyrixx We could remove the call todotize here as$i is always an integer, right?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, in 4.2, we are using a hash, so a string (so I'm going to change%d to%s in 4.2).

This was referencedMay 1, 2019
@lyrixxlyrixx deleted the workflow-dump branchMay 1, 2019 19:05
@ruudk
Copy link
Contributor

ruudk commentedMay 4, 2019
edited
Loading

Is this actually what you want? Because this makes large workflows very messy. Why not merge the transitions and show them with 1 arrow like this:
Image 2019-05-04 at 2 23 38 PM

This can be achieved easily with this change:

 protected function findEdges(Definition $definition) {     $dotEdges = [];      foreach ($definition->getTransitions() as $i => $transition) {         foreach ($transition->getFroms() as $from) {-            $dotEdges[] = [+            $dotEdges[$from.$transition->getName().'from'] = [                 'from' => $from,                 'to' => $transition->getName(),                 'direction' => 'from',                 'transition_number' => $i,             ];         }         foreach ($transition->getTos() as $to) {-            $dotEdges[] = [+            $dotEdges[$transition->getName().$to.'to'] = [                 'from' => $transition->getName(),                 'to' => $to,                 'direction' => 'to',                 'transition_number' => $i,             ];         }     }      return $dotEdges; }

@lyrixx
Copy link
MemberAuthor

@ruudk Because this graph is not accurate. According to this representation thecancel transition is enabled if and only if there is a token in (all) placesa,b, andc. But, according to the definition, there are 3cancel transition one froma, one fromb, and one fromc.

I hope it's more clear :)

ruudk reacted with thumbs up emoji

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

Reviewers

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@lyrixx@fabpot@ruudk@javiereguiluz@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp