Exemplo 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()
Exemplo 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()
Exemplo n.º 3
0
 def __check_state_exists(cls, state):
     if state not in cls.states:
         raise ForbiddenTransition()