def add_subprocess_to_diagram(self, process_id, subprocess_name, is_expanded=False, triggered_by_event=False,<EOL>node_id=None):
subprocess_id, subprocess = self.add_flow_node_to_diagram(process_id, consts.Consts.subprocess, subprocess_name,<EOL>node_id)<EOL>self.diagram_graph.node[subprocess_id][consts.Consts.is_expanded] = "<STR_LIT:true>" if is_expanded else "<STR_LIT:false>"<EOL>self.diagram_graph.node[subprocess_id][consts.Consts.triggered_by_event] ="<STR_LIT:true>" if triggered_by_event else "<STR_LIT:false>"<EOL>return subprocess_id, subprocess<EOL>
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.