From f639e101b73b19cc671da85569b62b3a66c945af Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Fri, 27 Aug 2021 11:40:38 -0400 Subject: [PATCH] Commit the skeleton API endpoints, so we can use them while developing the BPMN side of things. --- crc/api.yml | 59 +++++++++++++++++++++++++++++++++++++++++++++ crc/api/workflow.py | 8 ++++++ 2 files changed, 67 insertions(+) diff --git a/crc/api.yml b/crc/api.yml index 284a2b28..edb6ab98 100755 --- a/crc/api.yml +++ b/crc/api.yml @@ -568,6 +568,36 @@ paths: responses: '204': description: The workflow specification has been removed. + /workflow-specification/{spec_id}/reorder: + parameters: + - name: spec_id + in: path + required: true + description: The unique id of an existing workflow specification to validate. + schema: + type: string + - name: direction + in: query + required: true + description: The direction we want to move the spec - `up` or `down` + schema: + type: string + example: up + put: + operationId: crc.api.workflow.reorder_workflow_specification + summary: Move the workflow spec up or down in the display order + tags: + - Workflow Specifications + responses: + '200': + description: An array of workflow specifications + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/WorkflowSpec" + /workflow-specification/{spec_id}/validate: parameters: - name: spec_id @@ -685,6 +715,35 @@ paths: responses: '204': description: The workflow spec category has been removed. + /workflow-specification-category/{cat_id}/reorder: + parameters: + - name: cat_id + in: path + required: true + description: The unique id of an existing workflow spec category to modify. + schema: + type: string + - name: direction + in: query + required: true + description: The direction you want to move the category - `up` or `down` + schema: + type: string + example: up + put: + operationId: crc.api.workflow.reorder_workflow_spec_category + summary: Move the workflow spec category up or down in the display order + tags: + - Workflow Specification Category + responses: + '200': + description: An array of workflow spec categories + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/WorkflowSpecCategory" /file: parameters: - name: workflow_spec_id diff --git a/crc/api/workflow.py b/crc/api/workflow.py index 05370221..fa9318ae 100644 --- a/crc/api/workflow.py +++ b/crc/api/workflow.py @@ -144,6 +144,10 @@ def delete_workflow_specification(spec_id): session.commit() +def reorder_workflow_specification(spec_id, direction): + pass + + def get_workflow_from_spec(spec_id): workflow_model = WorkflowService.get_workflow_from_spec(spec_id, g.user) processor = WorkflowProcessor(workflow_model) @@ -328,6 +332,10 @@ def delete_workflow_spec_category(cat_id): session.commit() +def reorder_workflow_spec_category(cat_id, direction): + pass + + def lookup(workflow_id, task_spec_name, field_id, query=None, value=None, limit=10): """ given a field in a task, attempts to find the lookup table or function associated