Skip to content
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

[Workflow] When entering default state, no workflow events are thrown #28319

Closed
ChangePlaces opened this issue Aug 30, 2018 · 2 comments
Closed

Comments

@ChangePlaces
Copy link

ChangePlaces commented Aug 30, 2018

Symfony version(s) affected: master

Description
An event is thrown when a workflow enters a place, except upon creating a new instance of an object, there is not a function to transition into the initial place, thus triggering the entered event.

@ChangePlaces ChangePlaces changed the title [Workflow] When entering default state, no events are thrown [Workflow] When entering default state, no workflow events are thrown Aug 30, 2018
@lyrixx
Copy link
Member

lyrixx commented Nov 8, 2018

Indeed, you are right. I made a PR for your issue, but it's a bit weird to me.
Could you explain to us why you need this event ?

@ChangePlaces
Copy link
Author

ChangePlaces commented Nov 8, 2018

Sure. In terms of workflow, it makes more sense to monitor when an object / item is in a certain state rather than having to monitor that state AND when an object is created as it's more complicated to update the system in the future.

The 'default' state (or whatever state is set) should be transitioned into when the item is created to enable the workflow listeners

nicolas-grekas added a commit that referenced this issue Dec 1, 2018
…g in the Workflow for the first time (lyrixx)

This PR was merged into the 4.3-dev branch.

Discussion
----------

[Workflow] Trigger `entered` event for subject entering in the Workflow for the first time

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28319
| License       | MIT
| Doc PR        |

Commits
-------

388840f [Workflow] Trigger `entered` event for subject entering in the Workflow for the first time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants