code: def bpmn_diagram_to_png(bpmn_diagram, file_name):
      
      g = bpmn_diagram.diagram_graph
      graph = pydotplus.Dot()
  
      for node in g.nodes(data=True):
  
          if node[1].get(consts.Consts.type) == consts.Consts.task:
              n = pydotplus.Node(name=node[0], shape="box", style="rounded", label=node[1].get(consts.Consts.node_name))
          elif node[1].get(consts.Consts.type) == consts.Consts.exclusive_gateway:
              n = pydotplus.Node(name=node[0], shape="diamond", label=node[1].get(consts.Consts.node_name))
          else:
              n = pydotplus.Node(name=node[0], label=node[1].get(consts.Consts.node_name))
          graph.add_node(n)
  
      for edge in g.edges(data=True):
          e = pydotplus.Edge(src=edge[0], dst=edge[1], label=edge[2].get(consts.Consts.name))
          graph.add_edge(e)
  
      graph.write(file_name + ".png", format='png')
docs: Create a png picture for given diagram
  
      :param bpmn_diagram: an instance of BPMNDiagramGraph class,
      :param file_name: name of generated file.