Skip to content

Commit

Permalink
bugfix: 生成 token 时对子流程进行去环操作
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang committed Dec 15, 2023
1 parent 1335400 commit 73a2097
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bamboo_engine/builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 73a2097

Please sign in to comment.