Skip to content

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

Closed
wants to merge 1 commit into from
Closed

add note about same-state transitions #8193

wants to merge 1 commit into from

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Jul 19, 2017

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.

@dbu
Copy link
Contributor Author

dbu commented Jul 19, 2017

actually i tested on symfony 3.3, but assume this is correct for 3.2 as well. was the entered event only added in 3.3? its only documented in the 3.3 doc.

@@ -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.
Copy link
Contributor

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?

@HeahDude HeahDude added this to the 3.2 milestone Jul 29, 2017
@xabbuh xabbuh modified the milestones: 3.3, 3.2 Aug 4, 2017
@javiereguiluz
Copy link
Member

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!

@dbu
Copy link
Contributor Author

dbu commented Jan 5, 2018

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.

@javiereguiluz
Copy link
Member

OK, let's reopen and let's ping @lyrixx, our biggest Workflow expert, what does he think about this. Thanks!

@javiereguiluz javiereguiluz reopened this Jan 5, 2018
@lyrixx
Copy link
Member

lyrixx commented Jan 5, 2018

This doc is valid and I think it worth mentioning it in the doc.

@javiereguiluz
Copy link
Member

It took us a long time, but this is finally merged. Thanks David.

javiereguiluz added a commit that referenced this pull request Jan 10, 2018
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
@dbu
Copy link
Contributor Author

dbu commented Jan 10, 2018

no worries, glad its useful after all :-)

@HeahDude
Copy link
Contributor

Yes thanks! I guess it will make more sense when/if the component handles tokens (transition weight) someday.

@lyrixx
Copy link
Member

lyrixx commented Jan 10, 2018

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

@dbu dbu deleted the patch-2 branch October 18, 2018 17:26
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.

6 participants