Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #22587 [Workflow] Add transition completed event (izzyp)
This PR was merged into the 3.4 branch. Discussion ---------- [Workflow] Add transition completed event | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#8213 --- Because the "entered" event is the only event dispatched after the new marking is applied, and publish's an event upon entering into a "Place" (as opposed to completing a transition), it is not sufficient for a lot of use cases and is causing bugs. Example: Enabled Transitions: 1. A -> B 2. B -> C 3. C -> B Transition 1 and transition 3, will dispatch an "entered" event on Place B, forcing post transition behaviour to be the same for both transition 1 and 3. A user might need different behaviour depending on the transition, rather the the destination. A concrete use case would be when applying an "undo" transition to a subject. One may or may not want to re-trigger all the events associated with the original transition to that Place. I propose adding a "completed" event (ie. Transition completed) in addition to the entered event. Commits ------- c254cac [Workflow] Added an transition completed event
- Loading branch information