From a38aa139a61268110721998cd9b411ce49ff25e1 Mon Sep 17 00:00:00 2001 From: burnettk Date: Tue, 14 Mar 2023 17:54:20 -0400 Subject: [PATCH] put back spiff step details for today --- .../services/process_instance_processor.py | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 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 54432f67..dd2b405a 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_processor.py @@ -102,6 +102,9 @@ from spiffworkflow_backend.services.user_service import UserService from spiffworkflow_backend.services.workflow_execution_service import ( execution_strategy_named, ) +from spiffworkflow_backend.services.workflow_execution_service import ( + StepDetailLoggingDelegate, +) from spiffworkflow_backend.services.workflow_execution_service import ( TaskModelSavingDelegate, ) @@ -1613,20 +1616,19 @@ class ProcessInstanceProcessor: save: bool = False, execution_strategy_name: Optional[str] = None, ) -> None: - """Do_engine_steps.""" - # NOTE: Commenting out to test how this changes performance: - # def spiff_step_details_mapping_builder( - # task: SpiffTask, start: float, end: float - # ) -> dict: - # self._script_engine.environment.revise_state_with_task_data(task) - # return self.spiff_step_details_mapping(task, start, end) - # - # step_delegate = StepDetailLoggingDelegate( - # self.increment_spiff_step, spiff_step_details_mapping_builder - # ) + # NOTE: To avoid saving spiff step details, just comment out this function and the step_delegate and + # set the TaskModelSavingDelegate's secondary_engine_step_delegate to None. + def spiff_step_details_mapping_builder( + task: SpiffTask, start: float, end: float + ) -> dict: + self._script_engine.environment.revise_state_with_task_data(task) + return self.spiff_step_details_mapping(task, start, end) + + step_delegate = StepDetailLoggingDelegate( + self.increment_spiff_step, spiff_step_details_mapping_builder + ) task_model_delegate = TaskModelSavingDelegate( - # secondary_engine_step_delegate=step_delegate, - secondary_engine_step_delegate=None, + secondary_engine_step_delegate=step_delegate, serializer=self._serializer, process_instance=self.process_instance_model, )