Bug 473420

Summary: containerView variable from container creation tool is not anymore visible
Product: [Modeling] Sirius Reporter: Melanie Bats <melanie.bats>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: maxime.porhel, pierre-charles.david
Version: 3.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Melanie Bats CLA 2015-07-23 11:11:10 EDT
With Sirius 2 it was possible to use the containerView variable from the precondition field of a container creation tool. With Sirius 3 this variable is not anymore available in the completion and at runtime with aql.
Comment 1 Maxime Porhel CLA 2015-07-24 03:17:56 EDT
I think this variable was never exposed (available in completion) but from what I see in the code [1], the containerView variable should be available for Node/ContainercreationTool.

[1] org.eclipse.sirius.diagram.tools.internal.command.builders.AbstractDiagramCommandBuilder.genericCheckPrecondition(EObject, AbstractToolDescription)
Comment 2 Maxime Porhel CLA 2015-07-24 11:54:20 EDT
Check with Mélanie: the variable is still available during the evaluation of the precondition. 

The containerView should be added in completion for the tool which use it during evaluation. An attempt was made by Cedric but it should be improved: see org.eclipse.sirius.business.api.dialect.description.AbstractInterpretedExpressionQuery.getAvailableVariables():


> if (this.target instanceof ToolDescription && feature == 
> ToolPackage.Literals.ABSTRACT_TOOL_DESCRIPTION__PRECONDITION) {
>    /*
>     * the containerView variable is accessible in the "precondition"
>     * feature of the ToolDescription. See GenericToolCommandBuilder.
>     */
>     availableVariables.put("containerView",
>   VariableType.fromString("viewpoint.DSemanticDecorator"));
> }

The diagram specific code should be in org.eclipse.sirius.diagram.business.internal.dialect.description.DiagramInterpretedExpressionQuery