Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A client can call a transition on a flow instance (using its identifier) #67

Open
Tracked by #58
tomtitherington opened this issue Feb 25, 2024 · 0 comments
Open
Tracked by #58
Labels
blocked: conflict/dependency Something else is blocking this. scope: backend Work involving the backend / Django REST project. scope: tests Work relating to tests. size: hours This should take less than a day. type: feature A piece of functionality of the product.

Comments

@tomtitherington
Copy link
Contributor

tomtitherington commented Feb 25, 2024

Background & Context*

Once a client has a valid Websocket connection to the server, they should be able to call a transition defined on a FlowSchema / TransitionSchema using the TransitionSchema.identifier.

Goal*

  • A client should be able to call the transition.
  • If the transition is valid then they will get an OK response.
  • If the transition is not valid they will get a FAIL response and appropriate error(s).
  • If the transition condition evaluates to False and cannot be executed then they will get a FAIL response with the appropriate error(s).

Implementation Details*

Requests and responses should adhere to the following format.

// Example request
{
  "action": "transition",
  "request_id": Date.now(),
  "data": {
    "flow_instance_id": "string",
    "step_schema_identifier": "string",
    "transition_schema_identifier": "string"

  }
}
// Example response
{
  "request_id": 1519211809934,
  "errors": [],
  "status": 200,
  "data" : {
    "result": "string (success, failure)"
    "message": "null | string (if result is failure)"
    "flow_instance_id": "string",
    "step_schema_id": "string",
    "transition_schema_identifier": "string",
  }
}

Acceptance Criteria*

Test cases that

  • Assert that given a valid TransitionSchema.identifer and FlowInstance.id the server will respond with a 200 / status OK.
  • Assert that given a valid TransitionSchema.identifer and FlowInstance.id the server will transition the flow and the current active flow should become the previously active flow.
  • Assert that given an invalid TransitionSchema.identifer or FlowInstance.id the server will respond with an error / status FAIL.

Dependencies

Blockers:

*required field.

This was referenced Feb 25, 2024
@tomtitherington tomtitherington added type: feature A piece of functionality of the product. scope: backend Work involving the backend / Django REST project. scope: tests Work relating to tests. size: hours This should take less than a day. blocked: conflict/dependency Something else is blocking this. labels Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: conflict/dependency Something else is blocking this. scope: backend Work involving the backend / Django REST project. scope: tests Work relating to tests. size: hours This should take less than a day. type: feature A piece of functionality of the product.
Projects
Status: 🔖 Planned
Development

No branches or pull requests

1 participant