docs: def delete_core_element_of_model(model, raise_exceptions=False, recursive=True, destroy=True, force=False):
      """Deletes respective core element of handed model of its state machine
  
      If the model is one of state, data flow or transition, it is tried to delete that model together with its
      data from the corresponding state machine.
  
      :param model: The model of respective core element to delete
      :param bool raise_exceptions: Whether to raise exceptions or only log errors in case of failures
      :param bool destroy: Access the destroy flag of the core remove methods
      :return: True if successful, False else
      """
      if isinstance(model, AbstractStateModel) and model.state.is_root_state:
          logger.warning("Deletion is not allowed. {0} is root state of state machine.".format(model.core_element))
          return False
      state_m = model.parent
      if state_m is None:
          msg = "Model has no parent from which it could be deleted from"
          if raise_exceptions:
              raise ValueError(msg)
          logger.error(msg)
          return False
      if is_selection_inside_of_library_state(selected_elements=[model]):
          logger.warning("Deletion is not allowed. Element {0} is inside of a library.".format(model.core_element))
          return False
      assert isinstance(state_m, StateModel)
  
      state = state_m.state
      core_element = model.core_element
  
      try:
          if core_element in state:
              state.remove(core_element, recursive=recursive, destroy=destroy, force=force)
              return True
          return False
      except (AttributeError, ValueError) as e:
          if raise_exceptions:
              raise
          logger.error("The model '{}' for core element '{}' could not be deleted: {}".format(model, core_element, e))
          return False