Skip to main content



      Home
Home » Modeling » UML2 » Copying model elements with stereotype applications.
Copying model elements with stereotype applications. [message #476399] Thu, 18 October 2007 12:49 Go to next message
Eclipse UserFriend
Originally posted by: firstname.name.gmail.com

Hey,

I need to copy a UML model. For this purpose I use the EcoreUtil.Copier, but the
copied model has lost information about stereotype applications.

How may I preserve stereotype information when I do a copy. I looked at
PackageOperations::StereotypeApplicationCopier() but it doesn't seem to achieve
this goal.

thanks.

--
F. Lagarde
Re: Copying model elements with stereotype applications. [message #476408 is a reply to message #476399] Mon, 22 October 2007 09:54 Go to previous message
Eclipse UserFriend
Hi Francois.

There is a similar defect open on that.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204658

As a suggestion to resolve this, you could determine if the element you are
copying has a stereotype applied to it. You could use
Element::getAppliedStereotypes(). Then for each applied stereotype, you
could get the profile that it belongs to. Try Stereotype::getProfile().
Then, in the destination model, make sure that the corresponding profile is
applied, then apply the stereotype to the element.
(I haven't looked at this problem in great detail yet so there may be more
efficient ways of doing this).

You may want to add your name to the notification list of the bug listed
above.

Cheers,
- James.


""Fran
Re: Copying model elements with stereotype applications. [message #625241 is a reply to message #476399] Mon, 22 October 2007 09:54 Go to previous message
Eclipse UserFriend
Hi Francois.

There is a similar defect open on that.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204658

As a suggestion to resolve this, you could determine if the element you are
copying has a stereotype applied to it. You could use
Element::getAppliedStereotypes(). Then for each applied stereotype, you
could get the profile that it belongs to. Try Stereotype::getProfile().
Then, in the destination model, make sure that the corresponding profile is
applied, then apply the stereotype to the element.
(I haven't looked at this problem in great detail yet so there may be more
efficient ways of doing this).

You may want to add your name to the notification list of the bug listed
above.

Cheers,
- James.


""Fran
Previous Topic:Needs uml models for testing puropose
Next Topic:Profile2EPackageConverter
Goto Forum:
  


Current Time: Sun Jul 20 21:11:23 EDT 2025

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

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

Back to the top