[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.uml] Re: Getting the UUID of a deleted model element

Eric,

To preserve UUIDs for objects removed from a resource and subsequently added to a different one, XMLResourceImpl  has
  /**
   * The map from {@link EObject} to {@link #getID ID}. It is used to store
   * IDs for objects that have been detached.
   */
  protected static final Map<EObject, String> DETACHED_EOBJECT_TO_ID_MAP = Collections.synchronizedMap(new WeakHashMap<EObject, String>());
You can see how they are used in attachedHelper and detachedHelper.

It's possible to access this protected static field from a derived XMLResourceImpl...


Eric wrote:
Hello,
I need to get the unique ID (UUID or XMI ID) of model element, when it is
deleted. I have a listener that is called when a model element is deleted.

I tried using GMFResource.getSavedID(), and ((XMLResource)
element.eResource()) however, they are both returning null.


Is there any other way to get the UUID after the deletion of model element?


Thank you in advance for your help.