Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » how to migrate uml to new definitions(migrate definitions and reduce profile size)
how to migrate uml to new definitions [message #1052267] Mon, 29 April 2013 21:57 Go to next message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
Hi!

I have a growing profile full of past definitions, that is 30 times the size it should be. Most of those definitions are not used by any uml, but some are.

I'd like to provide a tool that gets as input an UML with the huge profile applied, and migrate the uml to the new definitions, so that I could use my new profile that has only 200 kb. Of course, I will have to deal with the differences, programming the transition from new to old objects. But what I can't afford is a profile with 10 megabytes, that will have 100 megabytes somewhere in the future.

Any ideas of how could I implement it using EMF + UML2 ?

I did a similar question here http://www.eclipse.org/forums/index.php?t=msg&th=368994&

I was thinking in just give up using the api and go for xml+text processing, because I just can't figure out another way. But using xml+text is a terrible double work!

So, in a nutshell, I need something of the API that can tell me what version of each definition is applyed to each element of my uml, and then another api method that allows me to change the version (that would be great!) OR replace the application with a new one (I can code something that introspect EMF and create exact the same stereotype in the new version).

Thanks in advance.
Alex

Re: how to migrate uml to new definitions [message #1052317 is a reply to message #1052267] Mon, 29 April 2013 23:51 Go to previous messageGo to next message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
An example of what I do to get rid of an profile definition that had no structural difference in the applied model:
In the header:
-Remove the red zones (old profile references). Missing to remove something will mess up the file (I love how UML2 can be easily broken).
-rename profile_1 to profile

<xmi:XMI xmi:version="2.1" ... xmlns:persistence="http:///schemas/persistence/_t8NnMO_SEd2a1MB489CQ7g/118" xmlns:persistence_1="http:///schemas/persistence/_jr7BQJCNEeG7QrvFFZBJ9A/121" xsi:schemaLocation="http:///schemas/persistence/_t8NnMO_SEd2a1MB489CQ7g/118 persistence.profile.uml#_t8XYMO_SEd2a1MB489CQ7g http:///schemas/persistence/_jr7BQJCNEeG7QrvFFZBJ9A/121 persistence.profile.uml#_jr7BQZCNEeG7QrvFFZBJ9A">

in the body:
replace profile_1 with profile:
for instance:
<persistence_1:Embedded xmi:id="_79SHMD3qEeGltuoVZbUoRw" base_Property="_78ZWYD3qEeGltuoVZbUoRw"/>
will be
<persistence:Embedded xmi:id="_79SHMD3qEeGltuoVZbUoRw" base_Property="_78ZWYD3qEeGltuoVZbUoRw"/>

so... what I want to do is to identify , when I read the resource in uml2, what objects use stereotype "version _t8NnMO_SEd2a1MB489CQ7g/118" or version "_jr7BQJCNEeG7QrvFFZBJ9A/121". And then, programmatically update the version, and when it is the case, make necessary conversion.

because if I do something like this:

for (Stereotype st:el.getAppliedStereotypes()) {
   EClass def = st.getDefinition(); // it is not the "real definition", but the current

def (or the stereotype itself) will be the same class, no matter if the element is version x or y.

I hope this explained my doubt. I could do that using regex... Razz I just don't think it is the best approach.
Re: how to migrate uml to new definitions [message #1052748 is a reply to message #1052267] Tue, 30 April 2013 13:26 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Alex,

If you apply the profile to a model that has an older version applied,
then all of the stereotype applications in the model will be migrated
to their latest definitions. Of course, this works best when the
changes in the profile are compatible from version to version (usually
only adding new elements).

Do you need more complex transformations of the stereotype applications?

HTH,

Christian


On 2013-04-29 21:57:25 +0000, Alexandre Torres said:

> Hi!
>
> I have a growing profile full of past definitions, that is 30 times the
> size it should be. Most of those definitions are not used by any uml,
> but some are.
>
> I'd like to provide a tool that gets as input an UML with the huge
> profile applied, and migrate the uml to the new definitions, so that I
> could use my new profile that has only 200 kb. Of course, I will have
> to deal with the differences, programming the transition from new to
> old objects. But what I can't afford is a profile with 10 megabytes,
> that will have 100 megabytes somewhere in the future.
>
> Any ideas of how could I implement it using EMF + UML2 ?
>
> I did a similar question here
> http://www.eclipse.org/forums/index.php?t=msg&th=368994&
>
> I was thinking in just give up using the api and go for xml+text
> processing, because I just can't figure out another way. But using
> xml+text is a terrible double work!
>
> So, in a nutshell, I need something of the API that can tell me what
> version of each definition is applyed to each element of my uml, and
> then another api method that allows me to change the version (that
> would be great!) OR replace the application with a new one (I can code
> something that introspect EMF and create exact the same stereotype in
> the new version).
>
> Thanks in advance.
> Alex
Re: how to migrate uml to new definitions [message #1053715 is a reply to message #1052748] Tue, 07 May 2013 11:21 Go to previous message
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
You are right, this odd versioning is not happening anymore. I may be from some older version of UML, or some other odd bug. In fact, the garbage is always from a very old profile application.
Thank you!
Previous Topic:Migration from UML2 3.2.0 to 4.0 with Profiles and Stereotypes
Next Topic:How to write Eclipse UML2 XMI
Goto Forum:
  


Current Time: Fri Apr 19 14:28:07 GMT 2024

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

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

Back to the top