docs: def save_state_machine_as(path=None, recent_opened_notification=False, as_copy=False):
      """ Store selected state machine to path
  
       If there is no handed path the interface dialog "create folder" is used to collect one. The state machine finally
       is stored by the save_state_machine function.
  
      :param str path: Path of state machine folder where selected state machine should be stored
      :param bool recent_opened_notification: Flag to insert path of state machine into recent opened state machine paths
      :param bool as_copy: Store state machine as copy flag e.g. without assigning path to state_machine.file_system_path
      :return: True if successfully stored, False if the storing process was canceled or stopped by condition fail
      :rtype bool:
      """
  
      state_machine_manager_model = rafcon.gui.singleton.state_machine_manager_model
      selected_state_machine_model = state_machine_manager_model.get_selected_state_machine_model()
      if selected_state_machine_model is None:
          logger.warning("Can not 'save state machine as' because no state machine is selected.")
          return False
  
      if path is None:
          if interface.create_folder_func is None:
              logger.error("No function defined for creating a folder")
              return False
          folder_name = selected_state_machine_model.state_machine.root_state.name
          path = interface.create_folder_func("Please choose a root folder and a folder name for the state-machine. "
                                              "The default folder name is the name of the root state.",
                                              format_default_folder_name(folder_name))
          if path is None:
              logger.warning("No valid path specified")
              return False
  
      previous_path = selected_state_machine_model.state_machine.file_system_path
      if not as_copy:
          marked_dirty = selected_state_machine_model.state_machine.marked_dirty
          recent_opened_notification = recent_opened_notification and (not previous_path == path or marked_dirty)
          selected_state_machine_model.state_machine.file_system_path = path
  
      result = save_state_machine(delete_old_state_machine=True,
                                  recent_opened_notification=recent_opened_notification,
                                  as_copy=as_copy, copy_path=path)
      library_manager_model.state_machine_was_stored(selected_state_machine_model, previous_path)
      return result