favor user_input_required over waiting status for process instances w/ burnettk

This commit is contained in:
jasquat 2023-01-17 17:09:26 -05:00
parent d6edbe896a
commit e977788447
1 changed files with 7 additions and 3 deletions

View File

@ -1068,9 +1068,13 @@ class ProcessInstanceProcessor:
if bpmn_process_instance.is_completed(): if bpmn_process_instance.is_completed():
return ProcessInstanceStatus.complete return ProcessInstanceStatus.complete
user_tasks = bpmn_process_instance.get_ready_user_tasks() user_tasks = bpmn_process_instance.get_ready_user_tasks()
waiting_tasks = bpmn_process_instance.get_tasks(TaskState.WAITING)
if len(waiting_tasks) > 0: # if the process instance has status "waiting" it will get picked up
return ProcessInstanceStatus.waiting # by background processing. when that happens it can potentially overwrite
# human tasks which is bad because we cache them with the previous id's.
# waiting_tasks = bpmn_process_instance.get_tasks(TaskState.WAITING)
# if len(waiting_tasks) > 0:
# return ProcessInstanceStatus.waiting
if len(user_tasks) > 0: if len(user_tasks) > 0:
return ProcessInstanceStatus.user_input_required return ProcessInstanceStatus.user_input_required
else: else: