Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 506322

Summary: Replacing a VSM in the workspace with a different version is not always taken into account
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: normal    
Priority: P3 CC: florian.barbin, maxime.porhel
Version: 4.1.0Keywords: triaged
Target Milestone: 4.1.2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/83631
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3fc1d8d8e73f92561bcf26b20447bdb55371da74
https://git.eclipse.org/r/86702
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4fd1839a6a6a2d3dac43f980601b2b3cda3d82ce
https://git.eclipse.org/r/86796
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e2a8a5702147fda8cce854fd074d8af49aa176c4
Whiteboard: needtest
Bug Depends on:    
Bug Blocks: 506324    
Attachments:
Description Flags
Sample data to reproduce the bug none

Description Pierre-Charles David CLA 2016-10-21 06:22:56 EDT
Created attachment 264985 [details]
Sample data to reproduce the bug

This is somewhat similar to the "zombie viewpoints" of but #475598, but is actually a regression introduced by part of commit de35505b28c6c6f5d583f3616950708e36b02b73 for bug #442133.

Steps to reproduce:
1. Download an extract the attached zombie.zip archive *outside of the workspace*.
2. Import the plain project zombie/t and zombie/v1/zombie-vsm in the workspace. Make sure to check "Copy projects into the workspace".
3. Create a representation file on t/sample.ecore, enable the "zombie" viewpoint, and create a diagram on the EPackage in the model. The diagram should show a single EClass as a green square, as defined in v1 of the VSM.
4. While keeping the session and diagram editor open, delete the zombie-vsm project (with "Delete project contents from disk" checked).
5. Import zombie/v2/zombie-vsm in the workspace. Make sure to check "Copy projects into the workspace".
6. Refresh the representation. Nothing happens, it does not even become dirty. The v2 of the VSM defined the same node mapping with a different style (red diamond), but this is not taken into account (KO).
7. Close the session, reopen it and reopen the diagram. Now it is taken into account and the green square has become a red diamond.

This kind of scenario used to work, and while not critical as its does not correspond to a "canonical" use case, it is useful in the context of demos and tutorials, when you want to replace a modeler definition with a different version (e.g. revert to a known-good version if the user is lost during a tutorial).
Comment 1 Pierre-Charles David CLA 2016-10-21 06:30:16 EDT
I'm putting this in 4.1.1 for now because we have a patch which seems to fix the issue, but I'd like to get a more complete understanding of what happens when the bug occurs (as it is, the patch is simply a "blind" revert of the change which cause the regression), so this may be pushed to a later version if I can't dig into this before the deadline for 4.1.1.
Comment 3 Pierre-Charles David CLA 2016-11-29 11:36:04 EST
Fixed by 3fc1d8d8e73f92561bcf26b20447bdb55371da74.
Comment 4 Florian Barbin CLA 2016-12-01 11:05:33 EST
Verified on Sirius 4.1.2.201612011000.
Comment 5 Eclipse Genie CLA 2016-12-08 09:46:22 EST
New Gerrit change created: https://git.eclipse.org/r/86702
Comment 6 Pierre-Charles David CLA 2016-12-08 11:12:53 EST
Available in Sirius 4.1.2 (see https://wiki.eclipse.org/Sirius/4.1.2 for details).
Comment 8 Eclipse Genie CLA 2016-12-09 03:38:38 EST
New Gerrit change created: https://git.eclipse.org/r/86796