Bug 445111 - [Model Import] Refactor->Switch Libraries causes side-effects which means stereotypes get dropped from models
Summary: [Model Import] Refactor->Switch Libraries causes side-effects which means ste...
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Others (show other bugs)
Version: 1.0.1   Edit
Hardware: PC All
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Camille Letavernier CLA
QA Contact:
URL:
Whiteboard: dx deploy minor import
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 10:48 EDT by Ronan Bar CLA
Modified: 2014-11-05 09:52 EST (History)
4 users (show)

See Also:


Attachments
Video for RSA import issues (3.91 MB, application/octet-stream)
2014-09-25 11:14 EDT, Yuwen Hu CLA
no flags Details
Sample project for RSA Import Issue (8.39 KB, application/x-zip-compressed)
2014-09-25 11:15 EDT, Yuwen Hu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ronan Bar CLA 2014-09-25 10:48:17 EDT
Running the Refactor->Switch Libraries action causes certain models to lose stereotypes. We will provide more details in a further comment. Also it should be noted these side-effects are visible when the Apply button is pressed. Selecting cancel on the popup window does *not* undo the side-effects caused by the apply. Ctrl+Z once the popup has been dismissed is the only way to undo the damage.
Comment 1 Yuwen Hu CLA 2014-09-25 11:14:12 EDT
Created attachment 247371 [details]
Video for RSA import issues
Comment 2 Yuwen Hu CLA 2014-09-25 11:15:21 EDT
Created attachment 247372 [details]
Sample project for RSA Import Issue
Comment 3 Yuwen Hu CLA 2014-09-25 11:24:13 EDT
Here is the details for this bug.
We have a BlankPackage (already import from RSA to Papyrus), a BlankPackage2 (plan to import from RSA to Papyrus), a Profile which defines a Stereotype which reference by BlankPackage2.

1. Import Profile.epx, and then remove Profile.epx
2. Import BlankPackage2.epx
3. Double click the import result BlankPackge2, and then choose Profile.profile.uml to replace Profile.epx ref in "Repair Stereotype" dialogs.
4. Expand BlankPackage2, to check Class2 has the Generalization has the correct Stereotype from Profile.
5. Right-click BlankPackage2 in ModelExplorer to launch "Refactor" > "Switch Libraries...".
6. Choose BlankPacakge.uml in workspace to replace BlankPackage.epx and then click "Apply".
7. Now the Stereoype for the Generalization in Class2 get dropped.

Please check the video to sample project to reproduce the problem.
Comment 4 Camille Letavernier CLA 2014-09-26 05:53:01 EDT
The switch library algorithm updates all references to external elements, including Derived references (When they are modifyable). In this case, Class#general was set, which led to the deletion & re-creation of the Generalization (Thus losing stereotypes, and probably other useful information)

Commits d507a74 (Maintenance/Luna), 7472d59f (Master/Mars):

- Prevent modification of derived properties during the Switch Library action, to avoid similar side effects (Derived properties are properly recomputed anyway, e.g. when Generalization#general is changed, in this case)