-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
add note about same-state transitions #8193
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
actually i tested on symfony 3.3, but assume this is correct for 3.2 as well. was the |
@@ -238,6 +238,10 @@ order: | |||
* ``workflow.[workflow name].announce`` | |||
* ``workflow.[workflow name].announce.[transition name]`` | |||
|
|||
.. note:: | |||
|
|||
The leaving and entering events are triggered even for transitions that stay in same place. |
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.
What's the use case for such transitions? Should we really mention it?
I'm closing here because there's no feedback from the community and Jules wondered if we should document this at all. I don't use the Workflow component, so I can easily be wrong here. If that's the case, please tell me and we'll reopen this. Thanks! |
i do feel its relevant - at least to me it was not obvious. the use case is that you listen to transitions and either are surprised you get events for same-state transitions, or that you would want to do something on those transitions but are not aware that they do an event. a typical same-state transition would be to add items to a shopping cart. the state stays the same (open) but you might have listeners that update the cart with information or such things. so i think it would not hurt to have it in, but its not a big deal either. |
OK, let's reopen and let's ping @lyrixx, our biggest Workflow expert, what does he think about this. Thanks! |
This doc is valid and I think it worth mentioning it in the doc. |
It took us a long time, but this is finally merged. Thanks David. |
This PR was submitted for the 3.2 branch but it was merged into the 3.3 branch instead (closes #8193). Discussion ---------- add note about same-state transitions maybe this could be made more understandable, but "leave" and "enter" made me think a transition that "stays" in the same place would maybe not trigger those events. i checked the code and tested my application and in fact it works. i think it makes sense to mention this explicitly. if transitions are explained in more detail somewhere, it could be a good idea to also mention the possibility of same-place transitions there. Commits ------- 8736ec2 add note about same-state transitions
no worries, glad its useful after all :-) |
Yes thanks! I guess it will make more sense when/if the component handles tokens (transition weight) someday. |
I was thinking the same things when I commented |
maybe this could be made more understandable, but "leave" and "enter" made me think a transition that "stays" in the same place would maybe not trigger those events. i checked the code and tested my application and in fact it works. i think it makes sense to mention this explicitly.
if transitions are explained in more detail somewhere, it could be a good idea to also mention the possibility of same-place transitions there.