Bug 473420 - containerView variable from container creation tool is not anymore visible
Summary: containerView variable from container creation tool is not anymore visible
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-07-23 11:11 EDT by Melanie Bats CLA
Modified: 2018-12-18 04:59 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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