Conditional transitions

Step 1
Step 2

You can make a transition conditional by adding a handler which cancels the transition, from any of its lifecycle events (transition, event or state) and at any point (start, leave, enter, end).

To do this you can: