367 Commits

Author SHA1 Message Date
mike cullerton
fdf3dd497c Make sure we don't include archived files as attachments 2022-08-10 14:40:53 -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
mike cullerton
a1c5f0d492 Be explicit about values in data store service.
I.e., none of this adding variables to args, and counting them
2022-07-12 16:11:50 -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
Dan Funk
9378a2ae1f
Merge pull request #557 from sartography/chore/return-to-pi-api-759
Chore/return to pi api #759
2022-06-20 16:40:33 -04:00
mike cullerton
700c551e84 Script to retrieve Pre Reviews for a study 2022-06-20 11:26:06 -04:00
mike cullerton
fd0058355b Add more examples in the description 2022-06-20 09:21:13 -04:00
mike cullerton
6b651c3da1 pass the doc_code along with the file data when appending attachments to email 2022-06-15 17:06:33 -04:00
Dan Funk
d3a89b6af4
Merge pull request #554 from sartography/chore/delete-file-changes-750
Chore/delete file changes #750
2022-06-03 16:22:25 -04:00
mike cullerton
3924c33af4 Make sure we only delete files for the current study 2022-06-03 16:05:10 -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
Dan
0746848d8d just a little quick cleanup 2022-06-03 15:28:04 -04:00
mike cullerton
7c130cb840 Change delete_file script so that it defaults to deleting all files with the doc code, for the entire study.
Before this change, the script only deleted files for the current workflow.
You can now pass `study_wide=False` to only delete files for the current workflow
2022-06-03 13:24:32 -04:00
mike cullerton
e729c1e3d2 Raise an error if we don't have a logged in user 2022-06-01 13:36:20 -04:00
mike cullerton
2039631bd0 *** WIP ***
New script get_current_user
Replaces the current_user value that was removed from task data

Will also include information about the impersonating admin account if current_user is really an impersonation (view as)
2022-05-31 16:56:39 -04:00
mike cullerton
4bab660441 does this smell better 2022-05-27 10:37:06 -04:00
mike cullerton
1ca2bcd4a6 Allow attachments in emails to be filtered.
We use doc_codes to add attachments to emails
Sometimes, there are multiple files for a doc_code.
This allows us to filter the files associated with a doc_code
2022-05-27 10:22:59 -04:00
Dan
fb790fabe9 Merge branch 'dev' into chore/email-script-parameter-746 2022-05-26 11:51:01 -04:00
Dan Funk
d517f003e0
Merge pull request #546 from sartography/chore/create-template-option-745
Chore/create template option #745
2022-05-25 16:26:52 -04:00
Dan Funk
4aa753bef1
Merge pull request #545 from sartography/file-refactor-cleanup-743
File refactor cleanup #743
2022-05-25 16:25:03 -04:00
mike cullerton
71bbdf1d82 Change the way we handle attachments, so we can optionally filter the files returned for a particular doc_code
instead of passing a doc_code, we pass a tuple of (doc_code, file_names), where file_names is a list of file_names
We also accept a list of these tuples

Yeah, it's kind of wonky
2022-05-23 16:57:16 -04:00
mike cullerton
a97c21c8ed remove unused line 2022-05-23 14:27:25 -04:00
mike cullerton
e2feb2495d Added some spacing 2022-05-23 14:26:04 -04:00
mike cullerton
03384789d4 Modify complete_template script to accept optional file_name argument.
If present, we use file_name to name the generated file.
Otherwise, we use template_file_name to name the generated file
2022-05-23 14:20:52 -04:00
mike cullerton
4c24fde952 Code cleanup after file refactor 2022-05-20 10:47:14 -04:00
mike cullerton
b66bfb8a9b Merge branch 'dev' into chore/get-instance-script-729 2022-05-17 10:02:19 -04:00
mike cullerton
1b4821d2b9 Use a new INSTANCE_NAME variable for this, instead of SERVER_NAME 2022-05-17 09:59:33 -04:00
mike cullerton
e43df04116 New script that returns state and state_message for a workflow
- Requires a workflow_spec_id

- Returns a dictionary
  - {'state': 'required', 'message': 'This workflow is required.'},
  - {'state': None, 'message': None}

- Raises an error if no workflow_spec_id or if no workflow is found
2022-05-11 15:07:03 -04:00
mike cullerton
15d9eea96b New script that returns the SERVER_NAME of the current instance 2022-05-10 15:11:11 -04:00
mike cullerton
b52343903c Add name to email script and email_service 2022-04-25 15:38:15 -04:00
mike cullerton
97323279cf Merge branch 'dev' into email-name-parameter-726 2022-04-25 15:01:06 -04:00
Dan
c3e8793110 hot fix for issus with the new serializer. 2022-04-20 15:22:08 -04:00
mike cullerton
cf68367085 remove unused code
cleanup imports
2022-04-20 11:16:07 -04:00
Dan
5686b15de8 Don't return a boolean value for get_irb_info, that's just broken. 2022-04-20 11:00:31 -04:00
Dan
85d11d913f Merge branch 'dev' into feature/new_spiff_serializer 2022-04-20 10:59:58 -04:00
mike cullerton
fea9c969c2 document => file
file_refactor => file
2022-04-20 10:39:19 -04:00
mike cullerton
8e6ca4c97f DocumentModel => FileModel
document_id => file_id
2022-04-19 14:56:34 -04:00
mike cullerton
80560b96c4 doc_code is now required 2022-04-19 11:35:53 -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
4c81623497 return something for the validation 2022-04-19 08:01:18 -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
dca91b83f5 No longer a static method 2022-04-15 11:45:13 -04:00
mike cullerton
e10bc23623 We archive files now, we don't delete them 2022-04-15 11:44:38 -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
72f9ac33d0 Consolidate data_store scripts 2022-04-13 17:57:22 -04:00
mike cullerton
216c15ed1c FileModel => DocumentModel 2022-04-13 08:15:23 -04:00
mike cullerton
b732fee675 Merge branch 'dev' into file-refactor-705 2022-04-12 14:01:49 -04:00
mike cullerton
3be67a8bd9 FileModel => DocumentModel
Also, type is no longer an Enum field, no need to grab type.value
2022-04-12 13:44:58 -04:00