Interface ConcurrentFSM<F>

Defines an FSM that contains concurrent FSMs

interface ConcurrentFSM {
    currentState: OutputState;
    currentStateObservable: Observable<[OutputState, OutputState]>;
    currentSubFSM: undefined | FSM;
    initState: OutputState;
    inner: boolean;
    log: boolean;
    started: boolean;
    startingState: State;
    states: readonly State[];
    acceptVisitor(visitor): void;
    addHandler(handler): void;
    enterStdState(state): void;
    fullReinit(): void;
    getAllConccurFSMs(): readonly F[];
    onCancelling(): void;
    onError(err): void;
    onStarting(): void;
    onTerminating(): void;
    onTimeout(): void;
    onUpdating(): void;
    process(event): boolean;
    reinit(): void;
    removeHandler(handler): void;
    stopCurrentTimeout(): void;
    uninstall(): void;
}

Type Parameters

Hierarchy

  • FSM
    • ConcurrentFSM

Implemented by

Properties

currentState: OutputState

The current state of the FSM.

currentStateObservable: Observable<[OutputState, OutputState]>

An observable value for observing the current state of FSM during its execution.

currentSubFSM: undefined | FSM

The current sub FSM in which this FSM is while running.

initState: OutputState

The initial state of the FSM

inner: boolean

Defines whether the FSM is an inner FSM (ie, whether it is included into another FSM as a sub-FSM transition).

log: boolean

Logs (or not) information about the execution of the FSM.

started: boolean

True: The FSM started.

startingState: State

By default an FSM triggers its 'start' event when it leaves its initial state. In some cases, this is not the case. For example, a double-click interaction is an FSM that must trigger its start event when the FSM reaches... its terminal state. Similarly, a DnD must trigger its start event on the first move, not on the first press. The goal of this attribute is to identify the state of the FSM that must trigger the start event. By default, this attribute is set with the initial state of the FSM.

states: readonly State[]

The set of the states that compose the FSM. This returns a copy of the real set.

Methods

  • Reinitialises the FSM. Compared to [[FSM#reinit]] this method flushes the remaining events to process.

    Returns void

  • Processes an error produced in the FSM.

    Parameters

    • err: unknown

      The error to treat.

    Returns void

  • Jobs to do when a timeout transition is executed. Because the timeout transition is based on a separated thread, the job done by this method must be executed in the UI thread. UI Platforms must override this method to do that.

    Returns void

  • Processes the provided event to run the FSM.

    Parameters

    • event: Event

      The event to process.

    Returns boolean

    True: the FSM correctly processed the event.

  • Reinitialises the FSM. Remaining events to process are however not clear. See [[FSM#fullReinit]] for that.

    Returns void

  • Uninstall the FSM. Useful for flushing memory. The FSM must not be used after that.

    Returns void

Generated using TypeDoc