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