Skip to content

Only return child elements when Process.load_children is set

https://redmine.teklia.com/issues/11567

The Process.list_elements method needs to be updated:

  • When load_children is not set, keep the existing behavior;
  • When the process runs on the whole corpus without self.element or self.elements, keep the existing behavior;
  • When the process runs with self.element or self.elements set and load_children is set to direct, only return the direct children, and do not include self.element or self.elements;
  • When the process runs with self.element or self.elements set and load_children is set to all, only return the children recursively, and do not include self.element or self.elements.

Returning only the children, without duplicating them, might get us into the same trouble as in #769, so ListProcessElements needs to be tested carefully. While CTEs and UNION ALL might no longer be needed with this change, CTEs might still be useful to avoid this issue.