From ae798d0a8d81e9a3cdfb457cd48e42272bfd73fd Mon Sep 17 00:00:00 2001 From: hanshuaikang <1758504262@qq.com> Date: Fri, 15 Sep 2023 21:19:11 +0800 Subject: [PATCH] =?UTF-8?q?minor:=20=E6=94=AF=E6=8C=81=E5=AD=90=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline/contrib/rollback/graph.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/runtime/bamboo-pipeline/pipeline/contrib/rollback/graph.py b/runtime/bamboo-pipeline/pipeline/contrib/rollback/graph.py index 1ad7a4e2..1ee9577d 100644 --- a/runtime/bamboo-pipeline/pipeline/contrib/rollback/graph.py +++ b/runtime/bamboo-pipeline/pipeline/contrib/rollback/graph.py @@ -83,7 +83,7 @@ def build(self, node_id, source_id=None): return node_type = node_detail["type"] - if node_type in [PE.ExclusiveGateway, PE.ParallelGateway, PE.ConditionalParallelGateway, PE.ConvergeGateway]: + if node_type not in [PE.ServiceActivity]: self.others_nodes.append(node_id) if node_type == PE.ServiceActivity: @@ -95,16 +95,21 @@ def build(self, node_id, source_id=None): # 如果遍历到目标节点,则返回 if node_id == self.start_id: return - source_id = next_node_id targets = node_detail.get("targets", {}).values() + elif node_type == PE.SubProcess: + # 处理子流程 + source_id = self.build(node_detail["start_event_id"], source_id) + targets = node_detail.get("targets", {}).values() elif node_type == PE.ExclusiveGateway: targets = [target for target in node_detail.get("targets", {}).values() if target in self.node_map.keys()] else: targets = node_detail.get("targets", {}).values() for target in targets: - self.build(target, source_id) + source_id = self.build(target, source_id) + + return source_id def build_rollback_graph(self): """