@staticmethod<EOL><INDENT>def import_message_flow_to_graph(diagram_graph, message_flows, flow_element):<DEDENT>
flow_id = flow_element.getAttribute(consts.Consts.id)<EOL>name = flow_element.getAttribute(consts.Consts.name) if flow_element.hasAttribute(consts.Consts.name) else "<STR_LIT>"<EOL>source_ref = flow_element.getAttribute(consts.Consts.source_ref)<EOL>target_ref = flow_element.getAttribute(consts.Consts.target_ref)<EOL>message_flows[flow_id] = {consts.Consts.id: flow_id, consts.Consts.name: name,<EOL>consts.Consts.source_ref: source_ref,<EOL>consts.Consts.target_ref: target_ref}<EOL>diagram_graph.add_edge(source_ref, target_ref)<EOL>diagram_graph[source_ref][target_ref][consts.Consts.id] = flow_id<EOL>diagram_graph[source_ref][target_ref][consts.Consts.name] = name<EOL>diagram_graph[source_ref][target_ref][consts.Consts.source_ref] = source_ref<EOL>diagram_graph[source_ref][target_ref][consts.Consts.target_ref] = target_ref<EOL>'''<STR_LIT>'''<EOL>if consts.Consts.outgoing_flow not in diagram_graph.node[source_ref]:<EOL><INDENT>diagram_graph.node[source_ref][consts.Consts.outgoing_flow] = []<EOL><DEDENT>outgoing_list = diagram_graph.node[source_ref][consts.Consts.outgoing_flow]<EOL>if flow_id not in outgoing_list:<EOL><INDENT>outgoing_list.append(flow_id)<EOL><DEDENT>if consts.Consts.incoming_flow not in diagram_graph.node[target_ref]:<EOL><INDENT>diagram_graph.node[target_ref][consts.Consts.incoming_flow] = []<EOL><DEDENT>incoming_list = diagram_graph.node[target_ref][consts.Consts.incoming_flow]<EOL>if flow_id not in incoming_list:<EOL><INDENT>incoming_list.append(flow_id)<EOL><DEDENT>
Adds a new edge to graph and a record to message flows dictionary.
Input parameter is object of class xml.dom.Element.
Edges are identified by pair of sourceRef and targetRef attributes of BPMNFlow element. We also
provide a dictionary, that maps messageFlow ID attribute with its sourceRef and targetRef.
Method adds basic attributes of messageFlow element to edge. Those elements are:

- id - added as edge attribute, we assume that this is a required value,
- name - optional attribute, empty string by default.

:param diagram_graph: NetworkX graph representing a BPMN process diagram,
:param message_flows: dictionary (associative list) of message flows existing in diagram.
    Key attribute is messageFlow ID, value is a dictionary consisting three key-value pairs: "name" (message
    flow name), "sourceRef" (ID of node, that is a flow source) and "targetRef" (ID of node, that is a flow target),
:param flow_element: object representing a BPMN XML 'messageFlow' element.