- if parent_step_id is not None:
- try:
- parent_step = ProcessStep.by_id(db_conn, parent_step_id)
- if parent_step.owner_id != self.id_:
- parent_step_id = None
- except NotFoundException:
- parent_step_id = None
- assert isinstance(self.id_, int)
- step = ProcessStep(id_, self.id_, step_process_id, parent_step_id)
- walk_steps(step)
- self.explicit_steps += [step]
- step.save(db_conn) # NB: This ensures a non-None step.id_.
- return step
-
- def set_steps(self, db_conn: DatabaseConnection,
- steps: list[tuple[int | None, int, int | None]]) -> None:
- """Set self.explicit_steps in bulk."""