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): """