def add_merge_gateway_if_not_exists(merge_successor_id, bpmn_diagram):
merge_gateway_id = merge_successor_id + "<STR_LIT>"<EOL>if bpmn_diagram.diagram_graph.has_node(merge_gateway_id):<EOL><INDENT>just_created = False<EOL>return merge_gateway_id, just_created<EOL><DEDENT>else:<EOL><INDENT>just_created = True<EOL>process_id = default_process_id<EOL>gateway_type = get_merge_node_type(merge_successor_id, bpmn_diagram)<EOL>activity = "<STR_LIT>"<EOL>add_node_info_to_diagram_graph(merge_gateway_id, gateway_type, activity, process_id, bpmn_diagram)<EOL>return merge_gateway_id, just_created<EOL><DEDENT>
:param merge_successor_id:
:param bpmn_diagram:
:return: