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

Bug 456140

Summary: Variables are not available for TreeItem's semantic candidates expression
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: TreeAssignee: Belqassim Djafer <belqassim.djafer>
Status: CLOSED FIXED QA Contact: Maxime Porhel <maxime.porhel>
Severity: major    
Priority: P3 CC: maxime.porhel
Version: 1.0.0Keywords: triaged
Target Milestone: 3.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/41502
https://git.eclipse.org/r/47626
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=0726c2fd312256b7a3e9b38fcccb05e5cc7fcdd8
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=623f0db6eabf6a2387688ff316020546a0690f1f
Whiteboard:
Attachments:
Description Flags
Project with test VSM
none
Project with test data none

Description Pierre-Charles David CLA 2014-12-24 07:40:59 EST
When defining a TreeItem in a Tree description, some variables are supposed to be available for the semantic candidates expression (container, containerView...).
To put it simply, they are actually not available.

This is a major problem because it is thus impossible to know anything about the context excepted the semantic element defined by self (which should be the same than "container").

- For a TreeItem, "container" is never available using "var:container" or "[container/]"
- For tables, there is no problem.

Steps to reproduce :
- import the 2 provided projects : vsm and test project.
- open the tree and table
- in the tree, only one level is displayed
- in the table, 2 levels are displayed

Reproduced on Sirius master (3.0M4+), with an entry in the error log saying Compilation error for expression [container/] : Unrecognized variable: (container) when opening or refreshing the tree editor.

The root cause seems to be in org.eclipse.sirius.tree.business.internal.dialect.common.viewpoint.MappingBasedPartition.evaluate(EObject), which evaluates the semanticCandidatesExpression without setting any variable. Compare with org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.computeCurrentStatus(LineContainer, LineMapping, ECrossReferenceAdapter), which sets up containerView/container/root/viewpoint/table.
Comment 1 Pierre-Charles David CLA 2014-12-24 07:41:24 EST
Created attachment 249615 [details]
Project with test VSM
Comment 2 Pierre-Charles David CLA 2014-12-24 07:41:38 EST
Created attachment 249616 [details]
Project with test data
Comment 3 Belqassim Djafer CLA 2015-02-17 09:02:20 EST
Proposed fix : https://git.eclipse.org/r/#/c/41502
Comment 4 Eclipse Genie CLA 2015-05-11 08:35:43 EDT
New Gerrit change created: https://git.eclipse.org/r/47626
Comment 7 Maxime Porhel CLA 2015-05-12 09:39:15 EDT
Corrected has been merged on master for Sirius 3.0.0
Comment 8 Maxime Porhel CLA 2015-05-22 09:45:51 EDT
Validated on Sirius 3.0.0 RC1
Comment 9 Pierre-Charles David CLA 2015-06-24 11:14:04 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.