From 73a20971ea9056a803e7d1d02046b2c6d38c379d Mon Sep 17 00:00:00 2001 From: hanshuaikang <1758504262@qq.com> Date: Fri, 15 Dec 2023 11:37:28 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E7=94=9F=E6=88=90=20token=20?= =?UTF-8?q?=E6=97=B6=E5=AF=B9=E5=AD=90=E6=B5=81=E7=A8=8B=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=8E=BB=E7=8E=AF=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bamboo_engine/builder/builder.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bamboo_engine/builder/builder.py b/bamboo_engine/builder/builder.py index 30d4404..3a82cc5 100644 --- a/bamboo_engine/builder/builder.py +++ b/bamboo_engine/builder/builder.py @@ -162,9 +162,9 @@ def _delete_flow_id_from_node_io(node, flow_id, io_type): # recover to original format if ( - len(node[io_type]) == 1 - and io_type == "outgoing" - and node["type"] in ["EmptyStartEvent", "ServiceActivity", "ConvergeGateway"] + len(node[io_type]) == 1 + and io_type == "outgoing" + and node["type"] in ["EmptyStartEvent", "ServiceActivity", "ConvergeGateway"] ): node[io_type] = node[io_type][0] @@ -197,10 +197,17 @@ def _acyclic(pipeline): _delete_flow_id_from_node_io(target_node, flow_id, "incoming") +def _acyclic_flow(tree): + _acyclic(tree) + for node in tree["activities"].values(): + if node["type"] == "SubProcess": + _acyclic_flow(node["pipeline"]) + + def generate_pipeline_token(pipeline_tree): tree = copy.deepcopy(pipeline_tree) # 去环 - _acyclic(tree) + _acyclic_flow(tree) start_node = tree["start_event"] token = unique_id("t")