linkahead.common.state module#
- class linkahead.common.state.State#
Bases:
objectRepresents the state of an entity and take care of the serialization and deserialization of xml for the entity state.
An entity state is always a State of a StateModel.
Properties#
- namestr
Name of the State
- modelstr
Name of the StateModel
- descriptionstr
Description of the State (read-only)
- idstr
Id of the undelying State record (read-only)
- transitionsset of Transition
All transitions which are available from this state (read-only)
- property description#
- static from_xml(xml: _Element)#
Create a new State instance from an xml Element.
- Parameters:
xml (etree.Element)
- Returns:
state
- Return type:
- property id#
- to_xml()#
Serialize this State to xml.
- Returns:
xml
- Return type:
etree.Element
- property transitions#
- class linkahead.common.state.Transition#
Bases:
objectRepresents allowed transitions from one state to another.
Properties#
- namestr
The name of the transition
- description: str
The description of the transition
- from_statestr
A state name
- to_statestr
A state name
- property description#
- property from_state#
- static from_xml(xml: _Element) Transition#
- property name#
- property to_state#