linkahead.common.state module

class linkahead.common.state.State(model: str | None, name: str | None)

Bases: object

Represents 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)

static create_state_acl(acl: ACL)
property description
static from_xml(xml: _Element)

Create a new State instance from an xml Element.

Parameters:

xml (etree.Element)

Returns:

state

Return type:

State

property id
to_xml()

Serialize this State to xml.

Returns:

xml

Return type:

etree.Element

property transitions
class linkahead.common.state.Transition(name: str | None, from_state: str | None, to_state: str | None, description: str | None = None)

Bases: object

Represents 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