337 Commits

Author SHA1 Message Date
jpitts-uva
85e2a84642
Fix to prevent continuing Sentry "Working outside of application context" error. 2024-01-17 06:03:59 -05:00
mike cullerton
f900279a02 include workflow.user_id in the WorkflowApi Model 2022-12-01 12:24:08 -05:00
Dan
513d5664c1 Getting all tests passing with latest SpiffWorkflow. 2022-11-16 12:29:18 -05:00
Dan
2249965ade Paginator arguments changed slightly in latest releases of SQLAlchemy
Spiffworkflow 1.2:  Top Level Imports moved to appropriate modules
   - replace 'from SpiffWorkflow import WorkflowException' to 'from SpiffWorkflow.exceptions import WorkflowException'
   - replace 'from SpiffWorkflow import TaskState' to 'from SpiffWorkflow.task import TaskState'
   - replace 'from SpiffWorkflow import Task' to 'from SpiffWorkflow.task import Task'

SpiffWorkflow 1.2: Navigation code removed completely.  Proved to be of little use to folks, was super complex and difficult to maintain.

SpiffWorkflow 1.2: When inserting custom functions into the PythonExecutionEngine - be aware that the task data will act as the full context for execution, and will contain global functions and methods during the exec call.

SpiffWorkflow 1.2: All Task Specs now have a spec_type attribute, containing a descriptive string of the type, such as "User Task", "Script Task", "Start Event" etc...
2022-10-07 14:58:08 -04:00
Dan
5c76c90d04 send_file's arguments changed in a 2.2 of Flask.
Spiffworkflow 1.2:  remove all references of timeit (no longer in SpiffWorkflow)
Spiffworkflow 1.2:  pythonScriptEngine._evaluate no longer accepts a task argument.
Spiffworkflow 1.2:  CancelEventDefinition was removed - please use SignalEventDefinition instead
 EX: replace bpmn_workflow.signal('cancel')  # generate a cancel signal.
              bpmn_workflow.catch(CancelEventDefinition())
 WITH: bpmn_workflow.catch(SignalEventDefinition('cancel'))
Spiffworkflow 1.2:  Task States are JUST integers and TaskSpecNames is now a public dictionary, and can be used to covert a state to human readable string
    EX:  REPLACE:  user_task.state.name
         WITH:     TaskStateNames[user_task.state]
2022-10-05 15:31:56 -04:00
Dan
4305b36b74 Removed total_tasks and completed_tasks - as they are no longer used by the front end, and were dubious as hell to begin with.
Upraded SpiffWorkflow and now use th new get_subprocess_specs
updated the calculate_stats in the workflow processor - as the serialization had changed drastically, and needed to debug some performance issues.
Added a get_navigation method that will calcuate a basic navigation list MUCH faster than using the get_flat_nav_list in Spiffworkflows Navigation object.
Modified a hellton of tests because we don't have total_task and completed_task counts, or a complex nested navigation list anymore.
2022-07-20 12:10:23 -04:00
Dan
9ab29cf1fe Upgrade spiffworkflow - the WorkflowTaskExecException was moved - so we have to update all import statements. 2022-07-14 13:37:16 -04:00
mike cullerton
cd743b4a72 Clean up data_store set
Fix workflow_service to work with data_store_service
2022-07-13 11:47:30 -04:00
Dan Funk
d434602f55
Merge pull request #551 from sartography/chore/current-user-changes-755
Chore/current user changes #755  and lane permissions #737
2022-06-03 15:45:49 -04:00
mike cullerton
30d6c3ac36 Make sure we are in a lane 2022-06-02 15:56:45 -04:00
mike cullerton
906e02f81a Set the LOCKED state for StartEvent
We use this in lanes
2022-06-02 14:25:28 -04:00
mike cullerton
95c915a434 Remove code that doesn't let master workflow set state and state_message for admin sandbox workflows
Remove test for this feature
2022-05-26 13:35:30 -04:00
mike cullerton
5b2b2f7b60 better wording 2022-05-25 15:06:31 -04:00
mike cullerton
2c083f73a8 Add is_admin_workflow attribute to WorkflowApi and WorkflowApiSchema
Set is_admin_workflow when we instantiate WorkflowApi in WorkflowService.processor_to_workflow_api
2022-05-24 15:57:08 -04:00
mike cullerton
eb3011ae5f Don't let the master workflow change the state of workflows in the admin sandbox.
I.e., when category.admin is True

If a workflow is in the admin sandbox, we set the state to 'optional', no matter what the master workflow says

Added a method to get the category for a workflow spec.
2022-05-24 15:28:13 -04:00
Dan
e4627c472a rollback database transactions when we encounter an error resetting a workflow, or processing a waiting workflow. 2022-05-19 10:23:48 -04:00
Dan
063da419d0 updating for the last version of Spiffworkflow which deprecates the use of task.STATE values, in favor of TaskState.STATE, for example TaskState.READY 2022-05-10 12:28:55 -04:00
mike cullerton
3d2ba971f2 Include the state message 2022-05-09 08:31:46 -04:00
mike cullerton
f49615bfec Change item to workflow_spec_id 2022-05-06 17:54:05 -04:00
mike cullerton
b13aac84e7 Change workflow_state to state 2022-05-06 14:02:11 -04:00
mike cullerton
20a21b9267 Add workflow_state to processor_to_workflow_api method
Add new method to update workflow_state from master workflow
2022-05-06 08:53:54 -04:00
mike cullerton
0d7b26423c *** WIP ***
Skeleton for updating the workflows in a separate call
2022-04-29 17:40:30 -04:00
Dan
b1546d4ba1 Merge branch 'dev' into file-refactor-705 2022-04-27 12:12:47 -04:00
mike cullerton
cf68367085 remove unused code
cleanup imports
2022-04-20 11:16:07 -04:00
Dan
85d11d913f Merge branch 'dev' into feature/new_spiff_serializer 2022-04-20 10:59:58 -04:00
mike cullerton
8e6ca4c97f DocumentModel => FileModel
document_id => file_id
2022-04-19 14:56:34 -04:00
mike cullerton
fb5731ff23 Merge branch 'dev' into file-refactor-705
# Conflicts:
#	crc/scripts/delete_task_data.py
#	crc/services/workflow_processor.py
#	tests/base_test.py
#	tests/files/test_delete_task_data.py
2022-04-19 08:19:52 -04:00
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
e68c95f03c New serialization code, with the ability to load from the old serlializer if needed.
pipenv insisted on updating some other libraries so slight modifications for markupsafe.
2022-04-15 10:26:23 -04:00
mike cullerton
b304b4725b Merge branch 'dev' into file-refactor-705 2022-04-14 11:40:08 -04:00
mike cullerton
be24b598b8 Fix call to set_data_common - no longer have workflow_spec_id, add type of data set 2022-04-13 18:03:23 -04:00
mike cullerton
7d62c2dd18 FileModel => DocumentModel
from_models => from_document_model
2022-04-12 13:51:09 -04:00
Dan Funk
095105e3e6
Merge pull request #508 from sartography/validation-with-data-store-396
Validation with data store #396
2022-04-04 16:51:57 -04:00
Mike Cullerton
6ff0cdbb9d
Merge pull request #507 from sartography/bug/validating_data_security
Bug/validating data security #684
2022-03-29 09:41:02 -04:00
mike cullerton
4abdc4920f There was a problem if validate_study_id was 0 (zero). It evaluated to False 2022-03-25 10:04:05 -04:00
mike cullerton
5bf114b605 Initialize validation_data_store as empty list 2022-03-25 09:50:31 -04:00
mike cullerton
b884ce4c3a Remove debug print statement 2022-03-23 16:49:58 -04:00
mike cullerton
94abd7eebf *** WIP ***
Add a temporary data store for validation
2022-03-23 15:15:01 -04:00
Dan
7dfb0bbba9 assure we can use the right data when determining if a field is hidden. 2022-03-23 14:25:29 -04:00
alicia pritchett
487a1a3987 Fixes #667- Validate Lane Variables 2022-03-21 12:18:40 -04:00
Dan
c55cc4715d Fixing a bug that would cause us to evaluate the wrong field almost all of the time.
We looped over all the other fields in the task, to assure they at least had a null value, but in doing so, we overwrote the variable containing the field we were trying to test.
2022-03-09 15:26:29 -05:00
Dan
e3c1a908fe A better comment around a tricky part of the code. 2022-03-09 09:43:08 -05:00
Dan
41b5106a28 patching up the tests.
Looks like we want to use default values, if they are provided, for validation. So good test, and I didn't have to create a new bug.  Also added skipping the test about requiring a default for hidden+required fields.  Maybe we don't need to after all.
2022-03-08 18:38:05 -05:00
Dan
26eeb2912a Only run the form validation stuff if we have a form.
If there is a default value, use it, regardless of whether the form is hidden (this is how the front end works)
  (accomplished by moving the hide_epxression check -> continue stuff below the set default_value code)
2022-03-08 18:13:54 -05:00
Dan
b03e24bbf4 Properly handle forms where a field is required, based on a later field.
Do an aboutface on saying that if a field is required but hidden, it has to have a default value.  I'm just commenting this out for now, as it made getting these workflows to validate bloody impossible.
Clean up the replication of code for identifying required fields (as it wasn't consistently applied)
Removing some very broken and apparently unused methods.
2022-03-08 17:36:13 -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 Funk
84c420346d
Merge pull request #481 from sartography/feature/add-jinja-to-help-576
Feature/add jinja to help #576
2022-03-02 12:33:21 -05:00
Dan Funk
07e13584e7
Merge pull request #479 from sartography/nonetype-displayname-error-632
Clean up error message in test_spec
2022-03-01 16:20:20 -05:00
Dan Funk
cf77480803
Merge pull request #480 from sartography/bug/no-assignment-tasks-639
Fixes #650 - Approvals not Clearing When Completed
2022-03-01 16:19:51 -05:00