-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Workflow] Fixed bug of buildTransitionBlockerList when many transition are enabled #29141
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,15 @@ public function buildTransitionBlockerList($subject, string $transitionName): Tr | |
$transitionBlockerList = $this->buildTransitionBlockerListForTransition($subject, $marking, $transition); | ||
|
||
if ($transitionBlockerList->isEmpty()) { | ||
continue; | ||
return $transitionBlockerList; | ||
} | ||
|
||
// We prefer to return transitions blocker by something else than | ||
// marking. Because it means the marking was OK. Transitions are | ||
// deterministic: it's not possible to have many transitions enabled | ||
// at the same time that match the same marking with the same name | ||
if (!$transitionBlockerList->has(TransitionBlocker::BLOCKED_BY_MARKING)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could update the condition above: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But then the comment will be harder to understand because it applies to only one part of the if statement I prefer to keep it as it. Are you OK with that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, no blocker for me |
||
return $transitionBlockerList; | ||
} | ||
} | ||
|
||
|
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.
Should we mark this method as internal?
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.
It could be usefull to any one, isn't?
We could mark it internal, but I don't really see benefit of doing it.
It will update the code if you want.