-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
1d8f991
to
37b256c
Compare
foreach ($transitions as $transition) { | ||
foreach ($transition->getFroms() as $place) { | ||
if (!$marking->has($place)) { | ||
if ($marking->has($place) && Marking::STRATEGY_MULTIPLE_STATE === $strategy) { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
I'm sorry, but I have to close this PR as the current implementation is too complex |
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 theWorkflow
class based on the token strategy, some other changes had to be made about finding enabled transitions.