working a bit on the subtasks, I realized that currently, we have to link to parent_task_id two times:
first through the task code through the manager:
and second, we have to feed ProcessInfo with parent_task_id
I initially thought that within ProcessInfo.__init__ we should read parent_task_id from the task.
Then I realized that, as ProcessInfo.__init__ is anyway used to update fields from TaskModel,
it should be better to keep the same logic, and allow ProcessInfo.__init__ to generate the link between parent_task and sub_task if parent_task_id is provided.
That way, we gain a step, and the process of creating sub tasks is much easier (especially for new users).
And all previous implementations are still working the same (we just update the link between parent and sub task for nothing)
Hi Jedie,
working a bit on the subtasks, I realized that currently, we have to link to
parent_task_id
two times: first through the task code through the manager:and second, we have to feed
ProcessInfo
withparent_task_id
I initially thought that within
ProcessInfo.__init__
we should readparent_task_id
from the task.Then I realized that, as
ProcessInfo.__init__
is anyway used to update fields from TaskModel, it should be better to keep the same logic, and allowProcessInfo.__init__
to generate the link between parent_task and sub_task ifparent_task_id
is provided.That way, we gain a step, and the process of creating sub tasks is much easier (especially for new users).
And all previous implementations are still working the same (we just update the link between parent and sub task for nothing)