7 fsm.update
therealkrispet edited this page 2019-11-18 11:14:58 +01:00

Request

  • Description: Inquires about the current state of the FSM.
  • Subscribers: FSMHandler
{
    "key": "fsm.update"
}

Example: Same as above, does not have additional parameters.

Response

  • Description: Lists information about the FSM's internal state.
  • Subscribers: FSMAware
{
    "key": "fsm.update"
}
Parameter Type Required Description
current_state string ✔️ Name of the current FSM state.
in_accepted_state string ✔️ Tells whether the FSM is in its final state. On the platform, the challenge is considered finished when this property is true.
last_event object ✔️ Contains the source, destination, trigger keyword and timestamp of the latest transition.
valid_transitions array ✔️ Lists every possible transitions from the current step.

Example:

{
    "key": "fsm.update",
    "current_state": "1",
    "in_accepted_state": false,
    "last_event": {
        "from_state": "0",
        "timestamp": "2019-09-10T14:43:35.646400",
        "to_state": "1",
        "trigger": "step_1"
    },
    "valid_transitions": [
        {"trigger": "to_0"},
        {"trigger": "to_1"},
        {"trigger": "to_2"},
        {"trigger": "to_3"},
        {"trigger": "to_4"},
        {"trigger": "to_5"},
        {"trigger": "step_2"},
        {"trigger": "step_next"}
    ]
}