Dan Funk
4a916c1ee3
Created a "StudyService" and moved all complex logic around study manipulation out of the study api, and this service, as things were getting complicated. The Workflow Processor no longer creates the WorkflowModel, the study object handles that, and only passes the model into the workflow processor when it is ready to start the workflow.
...
Created a Study object (seperate from the StudyModel) that can cronstructed on request, and contains a different data structure than we store in the DB. This allows us to return underlying Categories and Workflows in a clean way.
Added a new status to workflows called "not_started", meaning we have not yet instantiated a processor or created a BPMN, they have no version yet and no stored data, just the possiblity of being started.
The Top Level Workflow or "Master" workflow is now a part of the sample data, and loaded at all times.
Removed the ability to "add a workflow to a study" and "remove a workflow from a study", a study contains all possible workflows by definition.
Example data no longer creates users or studies, it just creates the specs.
2020-03-30 08:00:16 -04:00
Dan Funk
b61a35f956
Merge remote-tracking branch 'origin/master' into feature/status_refactor
...
Fixing adding a study so all workflows are again added, will add status on those workflows based on output from the master bpmn diagram, which is coming shortly.
2020-03-27 11:55:36 -04:00
Dan Funk
c7d2c28178
Vastly more informative ApiError model that provides details on the underlying task where the error occured.
...
Added a validate_workflow_specification endpoint that allows you to check if the workflow will execute from beginning to end using random data.
Minor fixes to existing bpmns to allow them to pass.
All scripts must include a "do_task_validate_only" that restricts external calls and database modifications, but performs as much logic as possible.
2020-03-27 08:29:31 -04:00
Aaron Louie
f77ebe3177
Adds display order to categories
2020-03-26 15:29:52 -04:00
Dan Funk
bd92c230e4
Fix the API so we are clear what is being returned when updating a file.
2020-03-25 08:06:58 -04:00
Dan Funk
f4342fc785
It became impossible to use the Swagger ui when we started adding authentication to all of the calls. I discovered Connexion and Swagger have a default way of handing JTW authentication and this cleans up our code quite a bit, moves the securing of endpoints into the API Definition, which is quite nice, and removes a whole library dependency (I never get to do that!) I added a SWAGGER_AUTH_KEY that can be used in non-production environments to allow users to quickly authenticate from the Swagger ui. I also removed all api calls to simple little happy api services, because that is just mean and pointless.
2020-03-24 14:15:21 -04:00
Dan Funk
b35427523d
Merge remote-tracking branch 'origin/master' into feature/reference_files
...
# Conflicts:
# crc/models/file.py
# crc/services/file_service.py
# tests/data/reference/irb_documents.xlsx
# tests/test_files_api.py
2020-03-20 11:07:55 -04:00
Dan Funk
3eb1167b8e
Found a few errors in the sqlalchemy file definition that was causing failures, and had some consistency problems with the IRB Categories file name. The API was bailing out because we had restricted file types to bpmn,svg,or dmn in the connexion config file, I don't restrict this anymore we have plenty of checks elsewhere. Adding xlrd as a dependency - this didn't fail till a push to production.
2020-03-20 08:21:21 -04:00
Dan Funk
6e3b6c2635
Assure that files uploaded through web forms and files generated from templates can be cross-referenced to known document requirements from the protocol builder. Configurators can control this by managing an XLS Spreadsheet called "irb_documents.xslx".
...
Required Documents is becoming complicated, so making this it's own script task, removing it from study_info.py
The file_service is now very aware of this irb_documents file, so it will always need to exist. We seed this file
during setup, but it can be overwritten by the configurator.
2020-03-19 17:14:20 -04:00
Aaron Louie
ac7c7b42c4
Revert "Merge remote-tracking branch 'origin/feature/reference_files' into feature/workflow_spec_categories"
...
This reverts commit 9a26fc8e80
.
2020-03-18 17:05:13 -04:00
Aaron Louie
9a26fc8e80
Merge remote-tracking branch 'origin/feature/reference_files' into feature/workflow_spec_categories
2020-03-18 16:58:57 -04:00
Dan Funk
02be8ede75
Merge remote-tracking branch 'origin/master' into feature/reference_files
2020-03-18 15:16:34 -04:00
Aaron Louie
532d6b5dd6
Adds CRUD endpoints for workflow spec categories
2020-03-16 16:30:56 -04:00
Aaron Louie
7d31bc24eb
Attempting to address "FutureWarning: Implicit (flask) JSON serialization" warning
2020-03-16 13:24:15 -04:00
Aaron Louie
a98251237b
Adds workflow spec category to API
2020-03-16 12:10:32 -04:00
Dan Funk
779674ab60
Add the ability to upload and request general reference files by name. These will be used across workflows and will frequently contain lookup tables that can be referenced by various script tasks.
2020-03-13 15:03:57 -04:00
Aaron Louie
bbfe9291e0
Adds endpoint to get workflow stats. Adds a test for the endpoint.
2020-03-11 14:28:53 -04:00
Aaron Louie
f1b6718068
Adds task counts
2020-03-10 15:46:14 -04:00
Dan Funk
e91d7aff2f
Fixes #11 : adding a delete endpoint for studies. It won't delete studies that have workflows, you have to delete those first)
...
Removing the "default" error response from the api.yml, it was all noise.
2020-03-09 15:12:40 -04:00
Dan Funk
9fcd6f38f4
Merge remote-tracking branch 'origin/master' into feature/pb_services
2020-03-05 17:13:41 -05:00
Dan Funk
e501fb31fd
Cleaning up swagger docs.
2020-03-05 17:10:00 -05:00
Dan Funk
906bacff6a
Expose a flag on the workflow model in the api to shown if it is using the latest spec. Added a soft_reset and hard_reset onto the workflow endpoint that will allow you to cause a hard or soft reset.
2020-03-05 16:45:44 -05:00
Aaron Louie
01720a8bbf
Replaces migration and fixes broken tests
2020-03-03 16:02:01 -05:00
Dan Funk
94f828dfd6
Adding a simple endpoint that describes what scripts are currently available, along with a brief description.
2020-03-03 15:30:42 -05:00
Dan Funk
5e3fdaaa94
New set of "Tools" api endpoints, that provides a way to quickly render markdown or word documents by uploading json data and a template to populate.
...
Improved Error messages / Error processing. You can now just throw an APIError anywhere, and it will be properly serialized and returned.
2020-02-29 17:22:38 -05:00
Aaron Louie
3ef4860391
Adds user_uid and investigator_ids fields to Study. Gets studies from protocol builder and adds them if they aren't already in the database
2020-02-26 18:06:51 -05:00
Aaron Louie
002207cbca
Adds redirect URL to login handler
2020-02-24 16:59:16 -05:00
Aaron Louie
eb6354db6e
Moves sso_backdoor parameters to query string. Prevents duplication of user on update.
2020-02-21 11:24:39 -05:00
Aaron Louie
581434b453
Adds SSO header attributes
2020-02-20 15:43:29 -05:00
Dan Funk
1a9b5b50e5
Merge branch 'master' of github.com:sartography/cr-connect-workflow
2020-02-18 16:39:11 -05:00
Dan Funk
a642593e3d
Adding support to handle Single Sign On (Shibboleth) authentication using Flask SSO and an attribute map that has worked in the past with UVA's implementation. Aside from the new user endpoint, nothing requires authentication, but soon everything will expect it. I'm setting up a backdoor we can use for development and staging that will cause a round-robin affair that should make this relatively painless. Dropped "RestException" as we had two ways or raising errors, and that was silly.
2020-02-18 16:38:56 -05:00
Aaron Louie
16db1e3504
Adds default_value to Task schema
2020-02-18 10:14:03 -05:00
Aaron Louie
f142d02a30
Adds workflow_spec_id back in to WorkflowApi
2020-02-07 12:36:08 -05:00
Dan Funk
9bd93748be
Returning better cleaner information about workflow with the workflow endpoint. Removes the get_all_tasks and get_user_tasks endpoints as tasks are returned with the workflow. Workflow endpoint also includes the last task and next_task, which may or may not be user tasks. The task "type" returned is now the class name of the task_spec, rather than just the word "task".
2020-02-07 11:34:44 -05:00
Aaron Louie
5a6d589e6d
Adds form_field_key to API
2020-02-05 15:06:19 -05:00
Aaron Louie
3ee0426ba9
Adds workflow_id to file endpoints.
2020-02-04 14:26:53 -05:00
Aaron Louie
e717c25a25
Study ID is an integer. Task ID is a string.
2020-02-03 22:29:41 -05:00
Aaron Louie
0368657549
Adds ability to get FileModel records by study and task
2020-02-03 21:56:18 -05:00
Aaron Louie
e4b2a7a641
Adds endpoint to retrieve all user tasks for a workflow, regardless of state
2020-01-31 12:40:08 -05:00
Aaron Louie
918a6d5ab7
Removes unsupported read-only flag on File schema for now
2020-01-31 11:33:31 -05:00
Aaron Louie
a0e60ddd77
Renames endpoint methods for clarity. Adds endpoint for just updating file info.
2020-01-31 10:39:19 -05:00
Dan Funk
3fb831bae4
When you create a study, all possible workflows are then associated with that study.
2020-01-30 09:11:17 -05:00
Dan Funk
acca1523b7
adding an api call for getting a single workflow spec.
2020-01-28 10:14:06 -05:00
Aaron Louie
6aa3d711ce
Adds endpoint to delete workflow spec
2020-01-23 16:05:09 -05:00
Dan Funk
900819e647
fixing failed run
2020-01-14 15:39:54 -05:00
Aaron Louie
7ce48e8deb
Removes type hinting, in case that's breaking something.
2020-01-14 15:10:43 -05:00
Aaron Louie
054bd88760
Fixes path to api methods
2020-01-14 14:55:10 -05:00
Aaron Louie
790b0dfc3a
Adds endpoint for modifying existing workflow spec
2020-01-14 14:10:53 -05:00
Dan Funk
6361e94af5
Allow submitting data and progressing to the next task in a workflow.
2020-01-14 11:02:44 -05:00
Aaron Louie
75881bf1d3
Adds endpoint for adding a workflow specification
2020-01-13 21:43:09 -05:00