Commit Graph

561 Commits

Author SHA1 Message Date
Dan 5e54c90b47 "Reset" should not mean "re-start". Calling the reset_workflow script will now set the workflow to an "unstarted" state with no outstanding tasks, no json-state structure stored. The workflow is not yet running.
Also:
* Assured that arguments are consistent (we always seem to use workflow_spec_id, so I made sure we use that consistently.
* Don't require named parameters - so it's cool to call it like: reset_workflow('my_workflow_id')
* Task Actions (ie create, assign, etc...) are now an enumeration in the models, and not static variables on Workflow Service, so we can reference them consistently from anywhere.
* Removed some repetitive code
* Always try to validate as much as possible in the scripts to save folks time debugging.
*
2022-04-15 15:36:23 -04:00
Dan befc299475 Merge branch 'dev' into chore/fix_validation_errors 2022-03-19 09:53:12 -04:00
Dan e44ea6e13c merging in from dev. 2022-03-18 16:22:33 -04:00
mike cullerton eaf8dace97 Process categories in get_study api call 2022-03-18 16:05:01 -04:00
Dan Funk 52c1f2f919
Merge pull request #498 from sartography/staging-500-error
Staging 500 error
2022-03-18 15:53:41 -04:00
Dan Funk 08e116515b
Merge pull request #496 from sartography/bug/cancel-notify-668
Fixes #668 - Cancel/Notify Called when loading last task
2022-03-18 15:31:18 -04:00
Dan b7489aea43 merging in PI Name changes from Alicia's #499 PR. 2022-03-18 12:30:20 -04:00
alicia pritchett b9b8210f8a rm pi id refs 2022-03-18 12:04:20 -04:00
Dan ef5aca4fe4 ReviewType now comes back with the user studies, so we don't need to make an additional query to get it. 2022-03-18 09:59:10 -04:00
mike cullerton 276924960b Merge branch 'dev' into chore/fix_validation_errors 2022-03-18 08:36:03 -04:00
alicia pritchett 9b1a7ff286 Fixes #668 - Cancel/Notify Called when loading last task
don't call cancel notify if its an end event
2022-03-17 10:58:25 -04:00
mike cullerton 9a345da763 typo 2022-03-16 16:54:36 -04:00
alicia pritchett 5b7e71d42d meta field for categories 2022-03-16 12:49:35 -04:00
Dan 1506952df7 task_trace was a little mixed up in the errors. 2022-03-16 10:18:50 -04:00
alicia pritchett 37d92c6a5f WIP ~ adding a category metadata object 2022-03-15 10:49:41 -04:00
Dan Funk 791ab20f8c
Merge pull request #494 from sartography/chore/fix_validation_errors
Chore/fix validation errors
2022-03-14 16:51:27 -04:00
Dan 483d7e858b Improved Errors - Pick up on the new task_trace information in WorkflowException and pass it on through the api.
Also:  All script tasks should raise WorkflowTaskExecExceptions - NOT APIExceptions - this is because our scripts are executed by Spiff (not the other way around)  so the errors need to pass fluidly through spiff, and come back to use THEN we can convert them to APIErrors.  Otherwise we lose all kinds of good information about the error.
2022-03-14 16:00:53 -04:00
mike cullerton 3b049e358d Remove unused imports 2022-03-14 12:02:48 -04:00
Dan 2fc4b44ef3 Create a path to directly download the spreadsheet file (and avoid the weird dance on the front end of making an API call to get file data.)
Fixing pagination.  Seems the front end uses a page_index that is 0 based, and sqlAlchemy prefers to start at 1.
2022-03-12 16:19:07 -05:00
mike cullerton b753f06394 Changes to remove pagination for the get_logs scripts.
We only use pagination for the get_logs_for_study API endpoint. (Used on the study page)
2022-03-11 14:03:09 -05:00
mike cullerton 1bfe656817 Remove unused API endpoint to get logs for a workflow.
We have a script for this that is used (in workflows)
We do use the API endpoint to get logs for a study. (On the study page)
2022-03-11 14:01:06 -05:00
mike cullerton 2224e34a94 Remove unused imports
Finish up download_logs_for_study
2022-03-10 12:10:54 -05:00
mike cullerton bf31364b1f *** WIP ***
Committing to fix logging so we can use a level of 'metrics'
2022-03-09 13:07:56 -05:00
Dan 0a906a4b3c Cleaning up Print Statements (it was making it hard to see what was happening)
The Jinja2 service was treating all the task data as a possible template, modified it to only include the referenced templates.
(This turned out not to be the problem, but it seems like a good idea to keep it in place)
There is a terrible bug with the wordwrap pipe that will die without any details if you pass it a value of None.  We now cature the terrible error, and replace it with a sensible one.
Removed an unused Jinja_extensions file.
2022-03-08 15:46:36 -05:00
Dan 0455506e2b Loading latest chages from Spiff whic refactored the way the PythonExpressionEngine works.
This cleans up the _evaluate method which previously accepted arbitrary args and kwargs, and now requires an expression, a context to which exectute it, and, optionally, the current task being executed if the DMN is being executed as a part of a BusinessRuleTask in a BPMN diagram.

This also cleans up several bits of duplicated code.

There is also a bit of code here to assure that the current user is included when running the master workflow.
2022-03-04 15:34:36 -05:00
Dan a74ae647d6 Do not send cancel events if you are navigating to the current task. 2022-03-02 12:24:03 -05:00
Dan 91ed50e45e Be sure we update the document list when new workflow documents are added. 2022-02-28 15:49:21 -05:00
Dan ad17db067d mild little performance improvement. 2022-02-27 19:32:45 -05:00
Dan ebbb04a1af Fixing failing validation. 2022-02-27 10:00:44 -05:00
Dan Funk 140de7ed03
Merge pull request #473 from sartography/nonetype-displayname-error-632
Nonetype displayname error #632
2022-02-25 15:41:14 -05:00
mike cullerton 531802f927 Make sure we don't try to get WorkflowMetadata if the spec does not exist
This was raising a 500 error
2022-02-25 14:41:58 -05:00
Dan dde8873c9e 1. defer the loading of the bpmn_json when loading the workflow model. It can be stupidly larger. (see models/workflow.py)
2. Shave a little more time off the reset by not re-creating the whole WorkflowProcessor

cleaning up all the firsttime/sincetime statements.
2022-02-24 20:56:57 -05:00
Dan 3442655bd1 Performance Improvements:
1. Avoid ever re-generating the list of scripts that can be used in a script task.  Terribly expensive as we call eval constantly, and it never ever changes once the app starts. (see script.py changes, and comments)
2. Cache the DocumentStatus list in the flask session, so we calculate it at most once per API Call.  It's at least .25 seconds per call.  (see study_sevice)
3. We called UserFileService.get_files_for_study (which runs a db query EVERY time) for every possible document type.  Now we run the query once (study service line 321)
4. When returning a workflow, we looped through every single task in that workflow's navigation, and called the expensive spiff_task_to_api_task just to figure out it's proper display name. We run a much faster and more efficient method to calculate the display name naow (see workflow_service on lie 680, and 799)
5. A hellton of @timeit and sincetime() calls, that I want to leave in, to help debug any slowness on production.
2022-02-24 14:25:42 -05:00
Dan b72ecb8375 Another re-work to fix 619 - and to assure that we aren't rebuilding the lookup tables too frequently. 2022-02-17 11:59:48 -05:00
Dan f2b6008e5f Fixes 619 - look up models were being built incorrectly, and repeatedly, and sometimes bombed out all together.
bonus: resond with a valid error message when an invalid task_id is requested (don't just 500)
2022-02-17 11:04:50 -05:00
Dan 7a99859108 fixing some failing test 2022-02-11 11:00:42 -05:00
Dan 3993297360 minor fixes to the study api to get things working locally when we pull down a database from testing. 2022-02-10 18:19:57 -05:00
Dan eb7760fa55 Adding the migration - very destructive, but required for running the app.
minor fixes - there is still some weird problems with study id and user id being null that I need to track down, but the issue is sporadic, and hard to track down.
2022-02-10 11:50:31 -05:00
alicia pritchett 3ee95b3c39 gets master spec 2022-02-10 11:29:38 -05:00
Dan df3f67601c performance improvements. and last rements of load_example_data() 2022-02-09 23:29:39 -05:00
Dan f12c4aba52 Refactor the workflow_spec_service so it doesn't cache anything, it always reads what it needs from the file system. 2022-02-09 21:06:55 -05:00
Dan cf71f68ad9 all tests passing!!!!!!!!!!!!! 2022-02-09 15:30:07 -05:00
Dan 2cc20d4b9d really need to avoid any kind of caching in the WorkflowSpecService 2022-02-09 14:43:32 -05:00
Dan 7e7821a5e7 more test passing 2022-02-09 13:01:26 -05:00
Dan db93f9be4e fixing the test_spec_files 2022-02-09 12:44:54 -05:00
Dan f72b25d9be Merge branch 'feature/spec_files_wthout_db' of github.com:sartography/cr-connect-workflow into feature/spec_files_wthout_db 2022-02-09 11:37:58 -05:00
Dan 8e7c8c87c3 down to just 38 failed tests 2022-02-09 11:37:54 -05:00
alicia pritchett 5bd25b9f60 get all specs change 2022-02-09 11:34:17 -05:00
mike cullerton 1c033ce7f2 Merge branch 'feature/spec_files_wthout_db' of https://github.com/sartography/cr-connect-workflow into feature/spec_files_wthout_db 2022-02-09 10:55:19 -05:00
mike cullerton 9576089e84 Reorder categories 2022-02-09 10:55:02 -05:00