libSmalldb  v2.0.2
Public Member Functions | List of all members
TransitionGuard Interface Reference

Description

Interface TransitionGuard.

A transition guard tells the transition implementation decorator whether it may or may not allow a transition.

Guard before the transition: Is the given transition valid and allowed on a given state machine?

Assert after the transition: Is the new state machine state one of the states expected after the transition?

Inheritance diagram for TransitionGuard

Public Member Functions

 isTransitionAllowed (ReferenceInterface $ref, TransitionDefinition $transition)
 A simple and cost-effective check whether the transition can be invoked. More...
 

Member Function Documentation

◆ isTransitionAllowed()

isTransitionAllowed ( ReferenceInterface  $ref,
TransitionDefinition  $transition 
)

A simple and cost-effective check whether the transition can be invoked.

This check is called when we want to know wheter or not we can invoke the transition, but we have no intention of invoking the transition right now (e.g., when rendering a menu with available transitions).

Implemented in SimpleTransitionGuard, and AllowingTransitionGuard.