Bug 438421 - Custom variable not removed once tool has been executed
Summary: Custom variable not removed once tool has been executed
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-06-27 12:10 EDT by Stéphane Thibaudeau CLA
Modified: 2018-04-03 10:52 EDT (History)
2 users (show)

See Also:


Attachments
Sample VSM (4.68 KB, application/x-zip-compressed)
2014-06-27 12:10 EDT, Stéphane Thibaudeau CLA
no flags Details
Test modeling project (1.20 KB, application/x-zip-compressed)
2014-06-27 12:11 EDT, Stéphane Thibaudeau CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Thibaudeau CLA 2014-06-27 12:10:38 EDT
Created attachment 244607 [details]
Sample VSM

One can define custom variables inside a tool.
Once the tool has been executed, theses variables seem to be still here. It can be a source of very strange behaviours.

I've provided as attachment :
- a VSM based on Ecore,
- a test project

The VSM contains a simple diagram displaying the EClasses for an EPackage.

Steps to reproduce :
- import the VSM project
- launch a runtime
- import the test project
- open the test project and create a diagram on "first" EPackage => 3 EClasses are displayed on the diagram
- use "test" tool. This tool creates a new EClass. This tool also defines a custom variable named "eClassifiers" => the new Eclass is not displayed and the 3 Eclasses in "second" are now displayed.
This is because the "eClassifiers" variable has been defined as a list of all EClasses in model, and it was defined before the new EClass was created.
The EClass mapping's semantic candidates expression is "[eClassifiers/]". Once the tool has been executed it uses the "eClassifiers" variable, not the "eClassifiers" feature defined in the ecore metamodel.

Once the project is closed and reopened, the diagrams are correct. Until the tools are used.

NB : "test2" tools reveals the same underlying problem but it doesnt create a new instance. The other Eclasses don't appear on the diagram at once. But if you close and reopen the diagram they now appear.
Comment 1 Stéphane Thibaudeau CLA 2014-06-27 12:11:02 EDT
Created attachment 244608 [details]
Test modeling project
Comment 2 Florian Barbin CLA 2014-07-04 03:48:22 EDT
Reproduced. We already identified cases where variables can be in conflict with meta-model features (Sirius doc > specifier > Queries > Acceleo). This case is a little bit different since the "Reference name" seems to be correctly set but the creation tool seems to use the eClassifiers variable instead of the feature to create views.
Comment 3 Pierre-Charles David CLA 2017-09-27 05:32:54 EDT
Warning: some modelers (e.g. Capella) rely on custom variables set directly from Java services (and thus invisible from the VSM). Before making this change we should make sure with them that this would not break them (and see if the uses cases they have could be addressed more cleanly directly in Sirius).