diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py index c4bc4856..373d2101 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -1583,7 +1583,10 @@ class ProcessInstanceProcessor: finally: # clear out failling spiff tasks here since the ProcessInstanceProcessor creates an instance of the # script engine on a class variable. - if hasattr(self._script_engine, "failing_spiff_task") and self._script_engine.failing_spiff_task is not None: + if ( + hasattr(self._script_engine, "failing_spiff_task") + and self._script_engine.failing_spiff_task is not None + ): self._script_engine.failing_spiff_task = None # log the spiff step details so we know what is processing the process diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py index a83a60c3..b8d26142 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/task_service.py @@ -204,7 +204,7 @@ class TaskService: bpmn_process_json_data = cls.update_task_data_on_bpmn_process(bpmn_process, bpmn_process_data_dict) if bpmn_process_json_data is not None: - new_json_data_dicts[bpmn_process_json_data['hash']] = bpmn_process_json_data + new_json_data_dicts[bpmn_process_json_data["hash"]] = bpmn_process_json_data if bpmn_process_parent is None: process_instance.bpmn_process = bpmn_process diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py index 3f735901..d5af82cd 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py @@ -126,7 +126,9 @@ class TaskModelSavingDelegate(EngineStepDelegate): bpmn_definition_to_task_definitions_mappings=self.bpmn_definition_to_task_definitions_mappings, ) ) - bpmn_process_json_data = TaskService.update_task_data_on_bpmn_process(bpmn_process or task_model.bpmn_process, spiff_task.workflow.data) + bpmn_process_json_data = TaskService.update_task_data_on_bpmn_process( + bpmn_process or task_model.bpmn_process, spiff_task.workflow.data + ) self.task_models.update(new_task_models) self.json_data_dicts.update(new_json_data_dicts) json_data_dict_list = TaskService.update_task_model(task_model, spiff_task, self.serializer) diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py index 3d7b729b..2feb2d59 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py @@ -1,6 +1,5 @@ """Test Process Api Blueprint.""" import io -from SpiffWorkflow.task import TaskState import json import os import time @@ -10,6 +9,7 @@ from typing import Dict import pytest from flask.app import Flask from flask.testing import FlaskClient +from SpiffWorkflow.task import TaskState # type: ignore from tests.spiffworkflow_backend.helpers.base_test import BaseTest from tests.spiffworkflow_backend.helpers.test_data import load_test_spec diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py index bf244a64..0e46cf5f 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py @@ -5,11 +5,11 @@ import pytest from flask import g from flask.app import Flask from flask.testing import FlaskClient -from SpiffWorkflow.task import TaskState -from spiffworkflow_backend.exceptions.api_error import ApiError # type: ignore +from SpiffWorkflow.task import TaskState # type: ignore from tests.spiffworkflow_backend.helpers.base_test import BaseTest from tests.spiffworkflow_backend.helpers.test_data import load_test_spec +from spiffworkflow_backend.exceptions.api_error import ApiError from spiffworkflow_backend.models.group import GroupModel from spiffworkflow_backend.models.process_instance import ProcessInstanceModel from spiffworkflow_backend.models.process_instance import ProcessInstanceStatus @@ -319,7 +319,7 @@ class TestProcessInstanceProcessor(BaseTest): **{"set_in_test_process_to_call_script": 1}, } fourth_data_set = {**third_data_set, **{"a": 1, "we_move_on": True}} - fifth_data_set = {**fourth_data_set, **{'validate_only': False, 'set_top_level_process_script_after_gate': 1}} + fifth_data_set = {**fourth_data_set, **{"validate_only": False, "set_top_level_process_script_after_gate": 1}} expected_task_data = { "top_level_script": first_data_set, "manual_task": first_data_set, @@ -499,7 +499,9 @@ class TestProcessInstanceProcessor(BaseTest): process_instance_final = ProcessInstanceModel.query.filter_by(id=process_instance.id).first() processor_final = ProcessInstanceProcessor(process_instance_final) - spiff_task = processor_final.get_task_by_bpmn_identifier("script_task_two", processor_final.bpmn_process_instance) + spiff_task = processor_final.get_task_by_bpmn_identifier( + "script_task_two", processor_final.bpmn_process_instance + ) assert spiff_task is not None assert spiff_task.state == TaskState.WAITING assert spiff_task.data == {"my_var": "THE VAR"}