StateMachine

mod:State
synopsis:state machine

state machine

class DIRAC.Core.Utilities.StateMachine.State

Bases: object

class State

single state

class DIRAC.Core.Utilities.StateMachine.StateMachine(state=None, transTable=None)

Bases: object

class StateMachine

simple state machine

addTransition(fromState, toState, condition)

add transtion rule from :fromState: to :toState: upon condition :condition:

next(*args, **kwargs)

make transition to the next state

Parameters:
  • args (tuple) – args passed to condition
  • kwargs (dict) – kwargs passed to condition
setState(state)

set state

state

get current state