You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Events dispatched with the EventDispatcher and works as the Symfony kernel events.
This would seem to imply that one can simply follow the standard Symfony ways of registering an event listener. i.e. using services.yaml or Creating an Event Subscriber.
However, neither of those work, because Finite creates its own event dispatcher! When a new StateMachine is created, it creates a new StateMachineDispatcher() which creates...a new Symfony\Component\EventDispatcher\EventDispatcher.
So any Symfony event registered in the normal way will not listen to the event.
I'm using Symfony 4.4. The documentation at https://finite.readthedocs.io/en/master/usage/symfony.html#using-callbacks say:
This would seem to imply that one can simply follow the standard Symfony ways of registering an event listener. i.e. using services.yaml or Creating an Event Subscriber.
However, neither of those work, because
Finite
creates its own event dispatcher! When a new StateMachine is created, it creates a new StateMachineDispatcher() which creates...a newSymfony\Component\EventDispatcher\EventDispatcher
.So any Symfony event registered in the normal way will not listen to the event.
Solution
We have to connect our event listener to the
StateMachine
's dispatcher.The text was updated successfully, but these errors were encountered: