From b1e1a01785ce625ddba07b6bdd16fbc37c5cafca Mon Sep 17 00:00:00 2001 From: Elizabeth Esswein Date: Thu, 15 Dec 2022 11:39:28 -0500 Subject: [PATCH] reformat & fix types --- .../spiffworkflow_backend/routes/process_api_blueprint.py | 1 + .../services/process_instance_processor.py | 8 +++++--- .../services/process_instance_service.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index c0a84c52c..d27805d6d 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -2041,6 +2041,7 @@ def update_task_data( mimetype="application/json", ) + def send_bpmn_event(process_instance_id: str, body: Dict) -> Response: process_instance = ProcessInstanceModel.query.filter( ProcessInstanceModel.id == int(process_instance_id) 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 adff3bbfc..f06d0c17d 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -705,15 +705,17 @@ class ProcessInstanceProcessor: db.session.delete(at) db.session.commit() - def serialize_task_spec(self, task_spec: SpiffTask) -> dict[str, Any]: + def serialize_task_spec(self, task_spec: SpiffTask) -> Any: return self._serializer.spec_converter.convert(task_spec) - def send_bpmn_event(self, event_data: dict[str,Any]) -> None: + def send_bpmn_event(self, event_data: dict[str, Any]) -> None: payload = event_data.pop("payload", None) event_definition = self._event_serializer.restore(event_data) if payload is not None: event_definition.payload = payload - current_app.logger.info(f"Event of type {event_definition.event_type} sent to process instance {self.process_instance_model.id}") + current_app.logger.info( + f"Event of type {event_definition.event_type} sent to process instance {self.process_instance_model.id}" + ) self.bpmn_process_instance.catch(event_definition) self.do_engine_steps(save=True) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py index adee870fc..a83b998f8 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py @@ -279,7 +279,7 @@ class ProcessInstanceService: def spiff_task_to_api_task( processor: ProcessInstanceProcessor, spiff_task: SpiffTask, - add_docs_and_forms: bool = False + add_docs_and_forms: bool = False, ) -> Task: """Spiff_task_to_api_task.""" task_type = spiff_task.task_spec.spec_type