Merge pull request #43 from sartography/feature/bug_fixes

Found a number of bugs with the parallel multi-instance - pulling in …
This commit is contained in:
Dan Funk 2020-05-12 14:39:52 -04:00 committed by GitHub
commit 13c16ec179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

2
Pipfile.lock generated
View File

@ -783,7 +783,7 @@
"spiffworkflow": {
"editable": true,
"git": "https://github.com/sartography/SpiffWorkflow.git",
"ref": "f626ac6d4f035f3a65a058320efd8d33d1ec652a"
"ref": "bb83497f5128f6221113b090d8de84401b0f108f"
},
"sqlalchemy": {
"hashes": [

View File

@ -85,8 +85,7 @@ def delete_workflow_specification(spec_id):
def __get_workflow_api_model(processor: WorkflowProcessor):
spiff_tasks = processor.get_all_user_tasks()
user_tasks = list(map(WorkflowService.spiff_task_to_api_task, spiff_tasks))
user_tasks = [WorkflowService.spiff_task_to_api_task(t, add_docs_and_forms=True) for t in spiff_tasks]
workflow_api = WorkflowApi(
id=processor.get_workflow_id(),
status=processor.get_status(),

View File

@ -163,10 +163,14 @@ class WorkflowProcessor(object):
Useful for running the master specification, which should not persist. """
version = WorkflowProcessor.get_latest_version_string(spec_model.id)
spec = WorkflowProcessor.get_spec(spec_model.id, version)
try:
bpmn_workflow = BpmnWorkflow(spec, script_engine=WorkflowProcessor._script_engine)
bpmn_workflow.data[WorkflowProcessor.STUDY_ID_KEY] = study.id
bpmn_workflow.data[WorkflowProcessor.VALIDATION_PROCESS_KEY] = False
bpmn_workflow.do_engine_steps()
except WorkflowException as we:
raise ApiError.from_task_spec("error_running_master_spec", str(we), we.sender)
if not bpmn_workflow.is_completed():
raise ApiError("master_spec_not_automatic",
"The master spec should only contain fully automated tasks, it failed to complete.")