mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-24 19:21:31 +00:00
Created fsm.update (markdown)
parent
fdefd5f28f
commit
8ea4d30626
68
fsm.update.md
Normal file
68
fsm.update.md
Normal file
@ -0,0 +1,68 @@
|
||||
## Request
|
||||
* **Description**: Inquires about the current state of the FSM.
|
||||
* **Subscribers**: [FSMHandler](https://github.com/avatao-content/baseimage-tutorial-framework/wiki/FSMHandler)
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "update",
|
||||
"intent": "control",
|
||||
"scope": "zmq"
|
||||
}
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
**Example**:
|
||||
```json
|
||||
{
|
||||
"key": "fsm.update",
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
* **Description**: Lists information about the FSM's internal state.
|
||||
* **Subscribers**: [FSMAware](https://github.com/avatao-content/baseimage-tutorial-framework/wiki/FSMAware)
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "fsm.update",
|
||||
"intent": "event",
|
||||
"scope": "broadcast"
|
||||
}
|
||||
```
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------ |:--------:|:------------------:| --------------------------- |
|
||||
| *current_state* | `string` | :heavy_check_mark: | Name of the current FSM state. |
|
||||
| *in_accepted_state* | `string` | :heavy_check_mark: | 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` | :heavy_check_mark: | Contains the source, destination, trigger keyword and timestamp of the latest transition. |
|
||||
| *valid_transitions* | `array` | :heavy_check_mark: | Lists every possible transitions from the current step. |
|
||||
|
||||
***
|
||||
|
||||
**Example**:
|
||||
```json
|
||||
{
|
||||
"current_state": "1",
|
||||
"in_accepted_state": false,
|
||||
"intent": "event",
|
||||
"key": "fsm.update",
|
||||
"last_event": {
|
||||
"from_state": "0",
|
||||
"timestamp": "2019-09-10T14:43:35.646400",
|
||||
"to_state": "1",
|
||||
"trigger": "step_1"
|
||||
},
|
||||
"scope": "broadcast",
|
||||
"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"}
|
||||
]
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue
Block a user