Bug 483006

Summary: Bad context completion in field precondition of container creation tool
Product: [Modeling] Sirius Reporter: Julien Dupont <julien.dupont>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: florent.latombe, steve.monnier
Version: 3.1.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:
Attachments:
Description Flags
Bug with completion in precondition's field of Container Creation tool none

Description Julien Dupont CLA 2015-11-25 09:02:19 EST
Created attachment 258274 [details]
Bug with completion in precondition's field of Container Creation tool

During use a container creation tool if you try to know context in the precondition field, using for example feature: + "Ctrl + Space" the context return does not correct.
Context returned correspond to mapping of the container in creation but should be the element clicked.

Use examlple joins, 
Look the Container creation tool, in precondition field, use feature: + completion.
The context proposed by completion should be EPackage but it's EClass.
Comment 1 Florent Latombe CLA 2016-09-22 10:58:02 EDT
I have observed similar erroneous behaviors on "Edge Creation Tool" and "Node Creation Tool". The completion proposed for "self" by AQL or Acceleo3 is based on the type of the semantic element of the mapping(s) referenced by the tool ; while the real type of "self" is in fact that of the container that was clicked (as expected).

This explains why this issue does not impact the runtime and why starting any expression or model operation by setting yourself to context "var:container" (respectively "var:source", etc.) goes fine.

Workaround: don't use any expressions based on "self" in these tools, instead use "container", "source", etc. variables.

Note: this is on 3.1.3.201511201007