Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: How to get the same xmi:ids when re-creating a model ?
Re: How to get the same xmi:ids when re-creating a model ? [message #476011] Thu, 20 September 2007 11:41
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Florian,

If you must cross post please do so with a single posting addressed to
all the groups (as I've done with this reply). I do read theUML2
newsgroup so if I see a question there I can answer, I usually too.

XMLResource has methods like getID and setID that allow you to determine
the extrinsic ID of and object as well as to set it. So if you aways
know the correspondence between old object and new object, you can use
these two methods to copy the IDs, i.e.,
((XMLResource)newObject.eResource()).setID(((XMLResource)old Object.eResource()).getID(oldObject)),
or more simply
((XMLResource)newObject.eResource()).setID(oldObject.eResour ce.getURIFragment())
if every object definitely has an ID in which case the fragment will
always be the ID.


Florian Georg wrote:
> (cross-posting also to uml2 newsgroup)
>
> Hi,
>
> We currently face some issue during migration of our UML2 models
> to a more recent EMF version.
>
> There is a library model (UML <<modelLibrary>>), which elements (e.g.
> UML classes)
> are referenced in many of our existing UML models.
> We mustn't loose the references to the elements from that library
> during migration.
> The point is, that the model library itself is being
> created/updated by a batch job running on a server every n minutes
> ("synchronized from a DB").
>
> Now we have to migrate to a more recent UML2 (and hence EMF version), so
> we need to create a "new" model library, using a new batch job (which
> uses the updated UML2/EMF jars for loading/saving).
>
> Now the problem: As we have many UML models in the old format, that
> reference the elemets from the library, we need to
> re-create the library probably *with the same xmi:id* values -
> otherwise the references will be broken after migrating the UML models.
> (Migration of the "hosting" models and profiles is automatically done
> by our UML tool)
>
> So my question is: Is there a way to tell the new batch job to create
> xmi:ids in the same way as the old version did?
> If not, is there a clever way of doing some kind of one-shot
> migration? (e.g. doing something clever in XMIResourceImpl)
>
>
> Thanks for any hint !
> regards, Florian
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to get the same xmi:ids when re-creating a model ?
Next Topic:Re: How to get the same xmi:ids when re-creating a model ?
Goto Forum:
  


Current Time: Thu Mar 28 12:32:54 GMT 2024

Powered by FUDForum. Page generated in 0.03558 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top