Esempio n. 1
0
 def get_transition(cls, source_state, target_state):
     cls.check_transition(source_state, target_state)
     for trans in cls.transitions:
         for source in trans.source:
             if source.name == source_state and trans.target.name == target_state:
                 return trans.name
     raise ForbiddenTransition()
Esempio n. 2
0
 def __check_transition_between_states_exist(cls, source_state,
                                             target_state):
     for trans in cls.transitions:
         for source in trans.source:
             if source.name == source_state and trans.target.name == target_state:
                 return
     raise ForbiddenTransition()
Esempio n. 3
0
 def __check_state_exists(cls, state):
     if state not in cls.states:
         raise ForbiddenTransition()