State Machine

Available functions

All functions have to be called according to the ESI standard, using colons, e.g. lib:FUNCTIONNAME(params)

Documentation

ON_ENTER(stateMachine)

STATE:ON_ENTER callback of the STATE helper class

This callback is called, whenever a state is entered.

Parameters

self

the STATE object itself

stateMachine

the calling statemachine

Returns

nil, no return value needed.

ON_LEAVE(stateMachine)

STATE:ON_LEAVE callback of the STATE helper class

This callback is called, whenever a state is leafed.

Parameters

self

the STATE object itself

stateMachine

the calling statemachine

Returns

nil, no return value needed.

CONDITION(statenMachine)

TRANSITION:CONDITION callback

this function is evaluated in order to decide if a state transition is possible.

Parameters

self

the transition object itself.

stateMachine

the esi-state-machine calling this condition evaluation.

Returns

true if the condition for a state transition is meat, false otherwise.

ON_TRANSITION(statenMachine)

TRANSITION:ON_TRANSITION callback of the Transtion helper class

This callback is called, whenever a Transition is executed.

Parameters

self

the TRANSITION object itself

stateMachine

the calling statemachine

Returns

nil, no return value needed.

PREPARE(self)

PREPARE callback e.g. for input procesing

default implementation setting runTime and triggerTime to now If this callback should be overwritte with each instance of the esi-state-machine class. at least runTime and triggerTime must be set. no input parameters, inputs shall be read during the prepare phase.

Returns

returns nil, not return value needed.