def find_longest_path_tasks(path, qualified_nodes, node, bpmn_graph):
node_names = {"<STR_LIT>", "<STR_LIT>"}<EOL>outgoing_flows_list = node[<NUM_LIT:1>][consts.Consts.outgoing_flow]<EOL>if len(outgoing_flows_list) == <NUM_LIT:0>:<EOL><INDENT>tmp_path = copy.deepcopy(path)<EOL>tmp_path.append(node)<EOL>tmp_qualified_nodes = copy.deepcopy(qualified_nodes)<EOL>if node[<NUM_LIT:1>][consts.Consts.type] in node_names:<EOL><INDENT>tmp_qualified_nodes.append(node)<EOL><DEDENT>return tmp_path, tmp_qualified_nodes<EOL><DEDENT>else:<EOL><INDENT>longest_qualified_nodes = []<EOL>longest_path = copy.deepcopy(path)<EOL>longest_path.append(node)<EOL>for outgoing_flow_id in outgoing_flows_list:<EOL><INDENT>flow = bpmn_graph.get_flow_by_id(outgoing_flow_id)<EOL>outgoing_node = bpmn_graph.get_node_by_id(flow[<NUM_LIT:2>][consts.Consts.target_ref])<EOL>tmp_path = copy.deepcopy(path)<EOL>tmp_path.append(node)<EOL>tmp_qualified_nodes = copy.deepcopy(qualified_nodes)<EOL>if node[<NUM_LIT:1>]["<STR_LIT:type>"] in node_names:<EOL><INDENT>tmp_qualified_nodes.append(node)<EOL><DEDENT>if outgoing_node not in path:<EOL><INDENT>(path_all_nodes, path_qualified_nodes) = find_longest_path_tasks(tmp_path, tmp_qualified_nodes,<EOL>outgoing_node, bpmn_graph)<EOL>if len(path_qualified_nodes) > len(longest_qualified_nodes):<EOL><INDENT>longest_qualified_nodes = path_qualified_nodes<EOL>longest_path = path_all_nodes<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if len(tmp_qualified_nodes) > len(longest_qualified_nodes):<EOL><INDENT>longest_qualified_nodes = tmp_qualified_nodes<EOL>longest_path = tmp_path<EOL><DEDENT><DEDENT><DEDENT>return longest_path, longest_qualified_nodes<EOL><DEDENT>
:param path:
:param qualified_nodes:
:param node:
:param bpmn_graph:
:return: