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

Adding the specification for the API of Workflow manager #1454

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions docs/source/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,91 @@ We can also change the state recursively for all contained items, provide a comm
```{literalinclude} ../../src/plone/restapi/tests/http-examples/workflow_post_with_body.resp
:language: http
```

# Specification for the fetching and updating all the workflow present is Plone

We have to create a Get request for getting all the workflow. Post request for adding a
new workflow. Patch request for updating the existing workflow and Delete request for
deleting the specific requeset.

A workflow consist of state, transition and permission related to who can change this.

## For creating a workflow we need these field

1. Id(required)
2. Title
3. Description

## For creating a sate we need these field

1. Id(required)
2. Title
3. Description
4. Possible Transitions
5. Permission field of this state


## For creating a Transition we need these field

1. Id(required)
2. Title
3. Description
4. Destination state
5. Permission
6. Display in action box( this should be just name)

Trigger wil be intiated by the user action


# API Specification

## Get

We can make a get request to `/@@workflow which will fetch a list of all workflow with

1. Id
2. title
3. description
4. @id

For fetching the data of specific workflow we should make a `/@@worflow/[@id]` endpoint
which fetches the data related to that specifc workfow and it must contains all the data.

response :-

1. id
2. title
3. description
4. @id
5. states
6. transitions

## Post

For creating a Post request we should have all the data which we are getting for the
specifc workflow and make request to `/@@workflow`.

payload :-

1. id
2. title
3. description
4. @id
5. states
6. transitions

## Patch

For updating the previous created workflow we have to make a patch request to individual
workflow `/@@workflow/[@id]` with the updated field.

## Delete

For deleting a workflow we just have to make a post request to individual workflow
`@@workflow/[@id]` with payload `Delete: true` and that workflow will be deleted.