Once a client has a valid Websocket connection to the server, they should be able to subscribe to change notifications from the FlowInstance and StepInstance models related to the current Person associated with the session.
Goal*
A client should be able to subscribe to active flow and active step changes for the specified person.
Implementation Details*
Calls to this endpoint should be idempotent. Calling this endpoint multiple times with the same parameters should always result in the same outcome. Subscribing once produces the same outcome as subscribing n times.
// Example request when subscribing to Flow state changes
{
"action": "subscribe_state_change",
"request_id" : Date.now(),
"data": {
"person_key": "string",
"entity" : "flow",
}
}
// Example request when subscribing to Step state changes
{
"action": "subscribe_state_change",
"request_id" : Date.now(),
"data": {
"person_key": "string",
"entity" : "step",
}
}
// Example response for Flow/Step state change subscriptions
{
"request_id": 1519211809934,
"errors": [],
"status": 200,
}
// Example events (flow and step changes)
{
"event": "state_change",
"request_id": 1519211809934,
"data": {
"entity": "flow",
"id": "string",
"identifier": "string",
"state": "string (active, inactive, completed, exited)",
"previous_state": "string"
}
}
{
"event": "state_change",
"request_id": 1519211809934,
"data": {
"entity": "step",
"id": "string",
"identifier": "string",
"state": "string (active, inactive, completed)",
"previous_state": "string"
}
}
Acceptance Criteria*
Test cases that
Assert that given a valid Person.id and entity type the server will respond with a 200 / status OK.
Assert that given a valid Person.id and entity type the server will provide a JSON response in the format and structure defined above.
Assert that once first called and the response was successful, changing the state of a flow or step will generate a response as outlined above.
Assert that an invalid Person.id or entity type will indicate that the Person.id or entity type was invalid or general 404.
Background & Context*
Once a client has a valid Websocket connection to the server, they should be able to subscribe to change notifications from the
FlowInstance
andStepInstance
models related to the currentPerson
associated with the session.Goal*
A client should be able to subscribe to active flow and active step changes for the specified person.
Implementation Details*
Calls to this endpoint should be idempotent. Calling this endpoint multiple times with the same parameters should always result in the same outcome. Subscribing once produces the same outcome as subscribing
n
times.Acceptance Criteria*
Test cases that
Person.id
and entity type the server will respond with a 200 / status OK.Person.id
and entity type the server will provide a JSON response in the format and structure defined above.Person.id
or entity type will indicate that thePerson.id
or entity type was invalid or general 404.Dependencies
Blockers:
22
62
*required field.