From d63aac09b6b8f3cb7bdbab51125b6962165861c7 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 26 Apr 2023 16:05:27 -0400 Subject: [PATCH] run_pyl --- .../src/spiffworkflow_backend/routes/tasks_controller.py | 8 +++++--- .../services/workflow_execution_service.py | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py index 3452efdd..2d30d093 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/tasks_controller.py @@ -20,7 +20,7 @@ from flask import make_response from flask import stream_with_context from flask.wrappers import Response from jinja2 import TemplateSyntaxError -from SpiffWorkflow.bpmn.workflow import BpmnWorkflow +from SpiffWorkflow.bpmn.workflow import BpmnWorkflow # type: ignore from SpiffWorkflow.exceptions import WorkflowTaskException # type: ignore from SpiffWorkflow.task import Task as SpiffTask # type: ignore from SpiffWorkflow.task import TaskState @@ -388,7 +388,7 @@ def _interstitial_stream(process_instance: ProcessInstanceModel) -> Generator[st processor = ProcessInstanceProcessor(process_instance) reported_ids = [] # A list of all the ids reported by this endpoint so far. - def get_reportable_tasks(): + def get_reportable_tasks() -> Any: return processor.bpmn_process_instance.get_tasks( TaskState.WAITING | TaskState.STARTED | TaskState.READY | TaskState.ERROR ) @@ -435,7 +435,8 @@ def _interstitial_stream(process_instance: ProcessInstanceModel) -> Generator[st spiff_task = processor.next_task() task_model = TaskModel.query.filter_by(guid=str(spiff_task.id)).first() -def get_ready_engine_step_count(bpmn_process_instance: BpmnWorkflow): + +def get_ready_engine_step_count(bpmn_process_instance: BpmnWorkflow) -> int: return len( list( [ @@ -446,6 +447,7 @@ def get_ready_engine_step_count(bpmn_process_instance: BpmnWorkflow): ) ) + def _dequeued_interstitial_stream(process_instance_id: int) -> Generator[str, Optional[str], None]: process_instance = _find_process_instance_by_id_or_raise(process_instance_id) with ProcessInstanceQueueService.dequeued(process_instance): 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 859e8aed..bb2e6b60 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py @@ -320,7 +320,6 @@ class RunUntilUserTaskOrMessageExecutionStrategy(ExecutionStrategy): if hasattr(task.task_spec, "extensions") and task.task_spec.extensions.get( "instructionsForEndUser", None ): - should_continue = False break self.delegate.will_complete_task(task) task.run()