betfsm.EventSequential

Bases: GeneratorWithList

EventSequential checks events in a sequential way. It can execute a nominal subtree or wait by ticking forever. If there are incoming events, these are queued in a FIFO way and the corresponding subtree is executed one by one. If any of the subtrees returns with an outcome different from TICKING or SUCCEED EventSequential finishes with that outcome.

The nominal state can be interrupted by the events, will pause while the subtrees corresponding to the events are executing, and, if all return SUCCEED, will resume after all subtrees are processed.

Typical use: - interrupt nominal state by event with cleanup - waiting when sequentially executing the subtrees associated with incomming events.

__init__(name, event_poller, event_map=Dict[str, TickingState])

Parameters:
  • name (str) –

    name of this node

  • event_poller (Callable[[Dict, List[str]], str | None]) –

    polling function from which we get the events.

  • event_map

    A map that maps events to BeTFSM subtrees. The subtree corresponding to the NO_EVENT entry is the nominal subtree. If there is no NO_EVENT entry specified, EventSequential will tick forever while listening to incomming events.

add_state(state)

Not defined for an EventSequential