do not restrict blank task list to not started pi but anytime the bpmn process is blank (#1644)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
jasquat 2024-05-30 14:18:40 +00:00 committed by GitHub
parent e6a102d498
commit e9022fd2b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ from spiffworkflow_backend.models.bpmn_process import BpmnProcessModel
from spiffworkflow_backend.models.bpmn_process_definition import BpmnProcessDefinitionModel
from spiffworkflow_backend.models.db import db
from spiffworkflow_backend.models.json_data import JsonDataModel # noqa: F401
from spiffworkflow_backend.models.process_instance import ProcessInstanceApiSchema, ProcessInstanceStatus
from spiffworkflow_backend.models.process_instance import ProcessInstanceApiSchema
from spiffworkflow_backend.models.process_instance import ProcessInstanceCannotBeDeletedError
from spiffworkflow_backend.models.process_instance import ProcessInstanceModel
from spiffworkflow_backend.models.process_instance import ProcessInstanceModelSchema
@ -380,8 +380,8 @@ def _process_instance_task_list(
bpmn_process = None
if bpmn_process_guid:
bpmn_process = BpmnProcessModel.query.filter_by(guid=bpmn_process_guid).first()
elif process_instance.bpmn_process_id is None and process_instance.status == ProcessInstanceStatus.not_started.value:
# if the process instance hasn't started yet then return a blank array only.
elif process_instance.bpmn_process_id is None:
# if the process instance does not have a bpmn process then return a blank array.
# this should help for issues like timer start events when viewing the corresponding instance.
return make_response(jsonify([]), 200)
else: