code: def add_subprocess_to_diagram(self, process_id, subprocess_name, is_expanded=False, triggered_by_event=False,
                                    node_id=None):
          
          subprocess_id, subprocess = self.add_flow_node_to_diagram(process_id, consts.Consts.subprocess, subprocess_name,
                                                                    node_id)
          self.diagram_graph.node[subprocess_id][consts.Consts.is_expanded] = "true" if is_expanded else "false"
          self.diagram_graph.node[subprocess_id][consts.Consts.triggered_by_event] = \
              "true" if triggered_by_event else "false"
          return subprocess_id, subprocess
docs: Adds a SubProcess element to BPMN diagram.
          User-defined attributes:
  
          - name
          - triggered_by_event
  
  
          :param process_id: string object. ID of parent process,
          :param subprocess_name: string object. Name of subprocess,
          :param is_expanded: boolean value for attribute "isExpanded". Default value false,
          :param triggered_by_event: boolean value for attribute "triggeredByEvent". Default value false,
          :param node_id: string object. ID of node. Default value - None.
          :return: a tuple, where first value is subProcess ID, second a reference to created object.