Removed WorkflowService.delete_test_data()

This commit is contained in:
NWalker4483 2021-06-22 11:29:00 -04:00
parent 4ca94b39ce
commit 369b518384
2 changed files with 39 additions and 42 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"python.pythonPath": "/Users/nilewalker/.local/share/virtualenvs/cr-connect-workflow-pBIHH0UI/bin/python"
}

View File

@ -110,12 +110,9 @@ class WorkflowService(object):
count = 0
while not processor.bpmn_workflow.is_completed():
if count < 100: # check for infinite loop
try:
processor.bpmn_workflow.get_deep_nav_list() # Assure no errors with navigation.
exit_task = processor.bpmn_workflow.do_engine_steps(exit_at=test_until)
if (exit_task != None):
WorkflowService.delete_test_data()
raise ApiError.from_task("validation_break",
f"The validation has been exited early on task '{exit_task.task_spec.name}' and was parented by ",
exit_task.parent)
@ -138,21 +135,18 @@ class WorkflowService(object):
WorkflowService.populate_form_with_random_data(task, task_api, required_only)
processor.complete_task(task)
if test_until == task.task_spec.name:
WorkflowService.delete_test_data()
raise ApiError.from_task("validation_break",
f"The validation has been exited early on task '{task.task_spec.name}' and was parented by ",
task.parent)
count += 1
except WorkflowException as we:
WorkflowService.delete_test_data()
raise ApiError.from_workflow_exception("workflow_validation_exception", str(we), we)
else:
if count >= 100:
raise ApiError.from_task(code='validation_loop',
message=f'There appears to be an infinite loop in the validation. Task is {task.task_spec.description}',
task=task)
WorkflowService.delete_test_data()
WorkflowService._process_documentation(processor.bpmn_workflow.last_task.parent.parent)
except WorkflowException as we:
raise ApiError.from_workflow_exception("workflow_validation_exception", str(we), we)
finally:
WorkflowService.delete_test_data(workflow_model)
return processor.bpmn_workflow.last_task.data