8000 [PoC] [Workflow] Allowed using multiple tokens by places by HeahDude · Pull Request #20508 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PoC] [Workflow] Allowed using multiple tokens by places #20508

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

Closed
wants to merge 2 commits into from

Conversation

HeahDude
Copy link
Contributor
@HeahDude HeahDude commented Nov 13, 2016
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets ~
License MIT
Doc PR ~

This is a PoC based on #20491, targeting 3.3, so only 37b256c is meant to be reviewed here.

This feature just updates the MultipleStateMarking and uses a default listener for the Workflow class based on the token strategy, some other changes had to be made about finding enabled transitions.

@HeahDude HeahDude force-pushed the workflow-multiple-tokens branch from 1d8f991 to 37b256c Compare November 13, 2016 19:36
@lyrixx lyrixx added this to the 3.3 milestone Nov 14, 2016
foreach ($transitions as $transition) {
foreach ($transition->getFroms() as $place) {
if (!$marking->has($place)) {
if ($marking->has($place) && Marking::STRATEGY_MULTIPLE_STATE === $strategy) {
Copy link
Member

Choose a reason for hiding this comment

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

this change is wrong. If there are multiple from, we must check all of them to be sure that the marking has them (it is a AND between them, not a OR)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand your comment right now, I'll come back on this after work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, it's now clear, I've understood it the wrong way. Thanks again :)

$marking = $event->getMarking();

foreach ($event->getTransition()->getTos() as $to) {
if (!$marking->has($to)) {
Copy link
Member

Choose a reason for hiding this comment

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

This looks weird to me. Why checking the target and blocking if we alread 8000 y have a marking there ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the listener is only guarding when there is no support for many tokens in one place.

@lyrixx
Copy link
Member
lyrixx commented Dec 13, 2016

I'm sorry, but I have to close this PR as the current implementation is too complex
(I have talked with @HeahDude IRL about this PR)

@lyrixx lyrixx closed this Dec 13, 2016
@nicolas-grekas nicolas-grekas modified the milestones: 3.x, 3.3 Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0