244 Commits

Author SHA1 Message Date
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
b15750d2e4 Cleaned up the Workflow Processor's init method
* removed all the performance metric code into a separate function.
* restructured the code so it is either creating a new workflow, or deserializing an old one.
* Added code to upgrade serialized objects from 1.0 to 1.1
* Using the new method of creating a bpmn_workflow object:
```python
                parser = self.get_spec_parser(self.spec_files, spec_info)
                top_level = parser.get_spec(spec_info.primary_process_id)
                subprocesses = parser.get_process_specs()
                self.bpmn_workflow = BpmnWorkflow(top_level, subprocesses, script_engine=self._script_engine)
```
Fixed a few minor bugs that stood out while testing
1. when updating a workflow, we should check for a valid task BEFORE calling cancel_notify, which requires a valid task.
2. get_localtime - quick fix on the date parser - for python 3.9.
3. the start_workflow script would error out in a way that made it unclear which workflow was having the problem.  Fixed the error.
2022-06-24 11:34:39 -04:00
mike cullerton
43e6a32841 Rewrite test_update_workflow_specification to make sure we update all metadata, and clean up old spec files and folders when changing category 2022-06-07 12:59:55 -04:00
mike cullerton
6911ab7aae Fixes for failing tests after removing current_user from task data 2022-05-31 16:53:15 -04:00
mike cullerton
91727ec75a first_task, second_task => task 2022-05-11 11:44:22 -04:00
mike cullerton
6fdf99a2e7 Add test for clear_data = True 2022-05-11 11:17:24 -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
Dan
b1546d4ba1 Merge branch 'dev' into file-refactor-705 2022-04-27 12:12:47 -04:00
Dan
85d11d913f Merge branch 'dev' into feature/new_spiff_serializer 2022-04-20 10:59:58 -04:00
mike cullerton
fbe9f5a17b DocumentModel => FileModel
document_id => file_id
clean up imports
2022-04-19 15:07:05 -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
mike cullerton
87b1e0d2c8 Fixes for tests 2022-04-19 07:51:29 -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
mike cullerton
ba24fba67e Remove print statement 2022-04-15 11:46:26 -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
d5ed949ed6 FileModel => DocumentModel
Remove unused imports
2022-04-13 08:31:18 -04:00
mike cullerton
3c418f7611 Rename workflow/test_workflow_data_store_validation to test_data_store_service 2022-04-05 11:35:41 -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
6b93d605d4 Test for new validation_data_store.
We set 3 `real` data_store values in the DB
The workflow sets 3 validation_data_store values
We assert that the correct values are returned.
We also assert that we get correct default values back if we pass in bad keys
2022-03-25 10:06:03 -04:00
mike cullerton
51fa494d03 Assert we evaluate the hidden property correctly during validation. 2022-03-23 16:49:35 -04:00
mike cullerton
94abd7eebf *** WIP ***
Add a temporary data store for validation
2022-03-23 15:15:01 -04:00
alicia pritchett
487a1a3987 Fixes #667- Validate Lane Variables 2022-03-21 12:18:40 -04:00
Dan
ce57a3753a fixing some comments and error messages for clarity 2022-03-09 10:28:22 -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
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
mike cullerton
9c0b5b9e16 Test for new feature 2022-03-01 16:17:34 -05:00
Dan Funk
896ce8934b
Merge pull request #477 from sartography/bug/645_document_updated
An optimization prevented us from picking up a change to the document…
2022-02-28 15:57:13 -05:00
mike cullerton
2ab3df2466 Force an error during test_spec, to make sure we clean up workflows 2022-02-28 14:02:26 -05:00
Dan
51a14311eb An optimization prevented us from picking up a change to the documents associated with a study. This assures that even if scripts run side by side, the document list will get updated, but only on a change. So it's still performant. Also added a sligthly better error message to the workflow service. 2022-02-28 12:17:21 -05:00
mike cullerton
2c427cc34c Temporary fix for variable issue in SpiffWorkflow.
There is a fix coming in SpiffWorkflow
2022-02-25 15:56:13 -05:00
mike cullerton
f2c97f80d5 Merge branch 'dev' into feature/delete-variable-script-584
# Conflicts:
#	Pipfile.lock
2022-02-25 15:54:34 -05:00
Dan Funk
e8617038ab
Merge pull request #461 from sartography/bug/missing-executabe-option-601
Bug/missing executabe option #601
2022-02-24 08:46:46 -05:00
Dan
9fc8158903 Merge branch 'feature/delete-variable-script-584' of github.com:sartography/cr-connect-workflow into feature/delete-variable-script-584 2022-02-21 14:30:41 -05:00
Dan
65ffc37787 fixing a bug in Spiff that was preventing our tests from passing. 2022-02-21 14:30:36 -05:00
mike cullerton
017f228dd9 Cleanup - create name for reused data 2022-02-21 14:01:35 -05:00
mike cullerton
6ec7241a7b Test for new script 2022-02-21 12:55:33 -05:00
mike cullerton
1cd3be70a7 Test for bug fix 2022-02-21 10:17:18 -05:00
Dan
a7f591d2ac Merge branch 'dev' into chore/variables-in-forms-550 2022-02-18 17:19:01 -05:00
Dan
b90be07bca Remove these bloodly log files from the repo. 2022-02-18 11:40:10 -05:00
alicia pritchett
753534c4cd Remove boolean tests
It could only be True or False now. And again this should be a frontend test now
2022-02-18 10:09:24 -05:00
alicia pritchett
ad58b67bb6 Delete read only field test
This is really something the frontend should be testing. Perhaps in the libraries test suite
2022-02-18 10:00:15 -05:00
alicia pritchett
7d597a82f4 mostly fixing bpmns 2022-02-18 09:48:02 -05:00
alicia pritchett
06dc20657b Fixing various BPMN's for tests 2022-02-17 17:29:44 -05:00
alicia pritchett
a5acd9b07e Merge branch 'dev' into chore/variables-in-forms-550 2022-02-17 15:04:41 -05:00