def import_event_definition_elements(diagram_graph, element, event_definitions):
        """
        Helper function, that adds event definition elements (defines special types of events) to corresponding events.

        :param diagram_graph: NetworkX graph representing a BPMN process diagram,
        :param element: object representing a BPMN XML event element,
        :param event_definitions: list of event definitions, that belongs to given event.
        """
        element_id = element.getAttribute(consts.Consts.id)
        event_def_list = []
        for definition_type in event_definitions:
            event_def_xml = element.getElementsByTagNameNS("*", definition_type)
            for index in range(len(event_def_xml)):
                # tuple - definition type, definition id
                event_def_tmp = {consts.Consts.id: event_def_xml[index].getAttribute(consts.Consts.id),
                                 consts.Consts.definition_type: definition_type}
                event_def_list.append(event_def_tmp)
        diagram_graph.node[element_id][consts.Consts.event_definitions] = event_def_list
def import_event_definition_elements ( diagram_graph , element , event_definitions ) : element_id = element . getAttribute ( consts . Consts . id ) event_def_list = [ ] for definition_type in event_definitions : event_def_xml = element . getElementsByTagNameNS ( "*" , definition_type ) for index in range ( len ( event_def_xml ) ) : event_def_tmp = { consts . Consts . id : event_def_xml [ index ] . getAttribute ( consts . Consts . id ) , consts . Consts . definition_type : definition_type } event_def_list . append ( event_def_tmp ) diagram_graph . node [ element_id ] [ consts . Consts . event_definitions ] = event_def_list
Helper function, that adds event definition elements (defines special types of events) to corresponding events.

        :param diagram_graph: NetworkX graph representing a BPMN process diagram,
        :param element: object representing a BPMN XML event element,
        :param event_definitions: list of event definitions, that belongs to given event.