From a31d89b25a840ec9d9d458c0cf5336b83d2288e9 Mon Sep 17 00:00:00 2001 From: burnettk Date: Thu, 2 Feb 2023 22:04:34 -0500 Subject: [PATCH] couple last serializer updates --- .../services/process_instance_processor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 022560c6..c9d43f92 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -30,6 +30,9 @@ from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine # type: ig from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import BasePythonScriptEngineEnvironment # type: ignore from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import Box from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import BoxedTaskDataEnvironment +from SpiffWorkflow.bpmn.serializer.task_spec import ( # type: ignore + EventBasedGatewayConverter, +) from SpiffWorkflow.bpmn.serializer.workflow import BpmnWorkflowSerializer # type: ignore from SpiffWorkflow.bpmn.specs.BpmnProcessSpec import BpmnProcessSpec # type: ignore from SpiffWorkflow.bpmn.specs.events.EndEvent import EndEvent # type: ignore @@ -43,9 +46,6 @@ from SpiffWorkflow.exceptions import WorkflowException # type: ignore from SpiffWorkflow.exceptions import WorkflowTaskException from SpiffWorkflow.serializer.exceptions import MissingSpecError # type: ignore from SpiffWorkflow.spiff.serializer.config import SPIFF_SPEC_CONFIG # type: ignore -from SpiffWorkflow.bpmn.serializer.task_spec import ( # type: ignore - EventBasedGatewayConverter, -) from SpiffWorkflow.task import Task as SpiffTask # type: ignore from SpiffWorkflow.task import TaskState from SpiffWorkflow.util.deep_merge import DeepMerge # type: ignore @@ -393,7 +393,7 @@ class ProcessInstanceProcessor: SPIFF_SPEC_CONFIG ) _serializer = BpmnWorkflowSerializer(wf_spec_converter, version=SERIALIZER_VERSION) - _event_serializer = EventBasedGatewayConverter() + _event_serializer = EventBasedGatewayConverter(wf_spec_converter) PROCESS_INSTANCE_ID_KEY = "process_instance_id" VALIDATION_PROCESS_KEY = "validate_only" @@ -971,7 +971,7 @@ class ProcessInstanceProcessor: def send_bpmn_event(self, event_data: dict[str, Any]) -> None: """Send an event to the workflow.""" payload = event_data.pop("payload", None) - event_definition = self._event_serializer.restore(event_data) + event_definition = self._event_serializer.registry.restore(event_data) if payload is not None: event_definition.payload = payload current_app.logger.info(