Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Copying elements from one model to another losing stereotypes
Copying elements from one model to another losing stereotypes [message #1709864] Thu, 01 October 2015 14:21 Go to next message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member
Hi,

I have a project made of a model file and a profile file.

New developments have been made in the model in // and I need to merge all of those in a single model.

What I did is that I loaded both projects in the same workspace, then select in the Project Explorer the source project and go to the Model Explorer and copy the element I am interesting in, then go back to the Project Explorer to select the target project, switch to the Model Explorer view and paste at the right location the element.

However when doing that the stereotypes are not copied.
Is there a way to copy the stereotypes? Or another way to merge projects?

I am using Papyrus 1.1.0 on Eclipse Mars.

Thanks and regards,

Marc
Re: Copying elements from one model to another losing stereotypes [message #1709927 is a reply to message #1709864] Fri, 02 October 2015 02:12 Go to previous messageGo to next message
Ri Fr is currently offline Ri FrFriend
Messages: 134
Registered: July 2015
Senior Member
I have not tried this in Papyrus, but I would assume that a Profile (and therefore stereotype) is a property of the MODEL, not of the Classifier. So it makes sense that if a Classifier moves to a new Model, it should lose the profiles and stereotypes of the old one. Logically I think you may need to define the Profile for the new Model and then manually assign Stereotypes to the moved Classifier.
Re: Copying elements from one model to another losing stereotypes [message #1709930 is a reply to message #1709927] Fri, 02 October 2015 05:50 Go to previous messageGo to next message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member
Thanks for the answer, but if confirmed, it is not a very good news, as the 2 profiles are exactly the same.

Is there any merge tool for Papyrus that would allow merging elements with their stereotypes?

Best regards,

Marc
Re: Copying elements from one model to another losing stereotypes [message #1709955 is a reply to message #1709930] Fri, 02 October 2015 08:53 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Marc,

This is supposed to work, but I can confirm the bug regarding Stereotypes applied on the copied elements, when you make a cross-editor copy/paste. This works fine when copy/pasting inside the same editor however.

The workaround would be to load the source model inside the target model (So you have both models loaded in the same editor), then make your copy/paste.

To do so:

- Open the target model
- In the model explorer, Right click on the root model -> Import -> Import package from user model
- Select your source model, press OK. The source model now appears in your model explorer (And you can open the diagrams as well if you want to make a graphical copy)
- Copy the elements you want from the source model, and paste them in your target model

Note that you need to manually apply the same profile before copying stereotyped elements. If the profile is not applied on the target model, stereotypes will not be applied during the paste.

HTH,
Camille


Camille Letavernier
Re: Copying elements from one model to another losing stereotypes [message #1710498 is a reply to message #1709955] Wed, 07 October 2015 07:54 Go to previous message
Peter Woerndle is currently offline Peter WoerndleFriend
Messages: 1
Registered: October 2015
Junior Member
I'm facing exactly the same issue as Marc does (we're working on the same model). I did some more analysis on the workaround as described below:

1. Exported the model as zip1
2. Imported the model from zip1 into new workspace1
3. Modified the model in workspace1
3a. Renamed the model
3b. Added a class with an additional stereotype
3c. Added an attribute with additional stereotype
3d. Added a comment
4. Exported the model as zip2 from workspace1
5. Imported the modified model from zip2 into workspace3
6. Imported the model from workspace3 into the original model as a package
7. Copied the new class to the trunk model from the package

Result is I lose all stereotypes and stereotype parameter values when copying from the package to the original model tree.

I'm using:
Version: Mars Release (4.5.0)
Build id: 20150621-1200

Best Regards,
/Peter
Previous Topic:How to remove the 'Imported' decoration in diagrams?
Next Topic:SVG shapes for Sequence Diagram
Goto Forum:
  


Current Time: Fri Apr 26 14:22:41 GMT 2024

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

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

Back to the top