[4.1] [API] Feature Request: Endpoint for workflow state action
Description:
- Front End API View has five urls dedicated to
workflows/workflow_templates/states/<workflow_template_state_id>/actions
mayan/apps/document_states/urls.py#L123 - API urls do not exist mayan/apps/document_states/urls.py#L275
- API views are not defined for state actions mayan/apps/document_states/api_views/workflow_template_api_views.py
Use case:
Our use case is related to consumption of documents with EXIF data which condition the document type. We wish to have an external manager for the pairs "file EXIF data"-"document type". The API manager has to be able to create document types and then immediately create an action on an existing state that changes document types based on the value. We do not wish to use the external manager to feed documents one by one to Mayan EDMS, documents are dumped in bulk to a watched folder by multiple workers. We would like to avoid to have to manually create the workflow state action (essentially change doc type with a string comparison condition)
We have other use cases, this one is the most critical.
Request:
- POST: api/v4/workflow_templates/id/states/id/actions/
{
"label": <string>,
"enabled": <boolean>,
"when": <integer>,
"action_path": <string>,
"action_data": <string>,
"condition": <string>
}
- GET: api/v4/workflow_templates/id/states/id/actions/id/
- PUT/PATCH: api/v4/workflow_templates/id/states/id/actions/id/
- DELETE: api/v4/workflow_templates/id/states/id/actions/id/