mirror of
https://github.com/sartography/spiffworkflow-backend.git
synced 2025-02-23 04:48:09 +00:00
highlight tasks even if they are in subprocesses of called activities w/ burnettk
This commit is contained in:
parent
9e4b37e7ab
commit
f1e399c87d
@ -548,6 +548,10 @@ def process_instance_task_list(
|
||||
spiff_tasks = processor.get_all_user_tasks()
|
||||
|
||||
subprocesses_by_child_task_ids = processor.get_subprocesses_by_child_task_ids()
|
||||
processor.get_highest_level_subprocesses_by_child_task_ids(
|
||||
subprocesses_by_child_task_ids
|
||||
)
|
||||
|
||||
tasks = []
|
||||
for spiff_task in spiff_tasks:
|
||||
calling_subprocess_task_id = subprocesses_by_child_task_ids.get(
|
||||
|
@ -646,6 +646,23 @@ class ProcessInstanceProcessor:
|
||||
subprocesses_by_child_task_ids[task_id] = subprocess_id
|
||||
return subprocesses_by_child_task_ids
|
||||
|
||||
def get_highest_level_subprocesses_by_child_task_ids(
|
||||
self, subprocesses_by_child_task_ids: dict
|
||||
) -> dict:
|
||||
"""Ensure task ids point to the top level subprocess id.
|
||||
|
||||
This is done by checking if a subprocess is also a task until the subprocess is no longer a task.
|
||||
"""
|
||||
for task_id, subprocess_id in subprocesses_by_child_task_ids.items():
|
||||
if subprocess_id in subprocesses_by_child_task_ids:
|
||||
subprocesses_by_child_task_ids[task_id] = (
|
||||
subprocesses_by_child_task_ids[subprocess_id]
|
||||
)
|
||||
self.get_highest_level_subprocesses_by_child_task_ids(
|
||||
subprocesses_by_child_task_ids
|
||||
)
|
||||
return subprocesses_by_child_task_ids
|
||||
|
||||
def save(self) -> None:
|
||||
"""Saves the current state of this processor to the database."""
|
||||
self.process_instance_model.bpmn_json = self.serialize()
|
||||
|
Loading…
x
Reference in New Issue
Block a user