| Summary: | AcceleoEvaluationException on a diagram after a new element's creation in a table | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Stéphane Thibaudeau <stephane.thibaudeau> | ||||||
| Component: | Core | Assignee: | Pierre-Charles David <pierre-charles.david> | ||||||
| Status: | CLOSED FIXED | QA Contact: | Laurent Redor <laurent.redor> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | laurent.redor, pierre-charles.david | ||||||
| Version: | 2.0.5 | Keywords: | triaged | ||||||
| Target Milestone: | 2.0.7 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| See Also: |
https://git.eclipse.org/r/54458 https://git.eclipse.org/r/54459 https://bugs.eclipse.org/bugs/show_bug.cgi?id=461498 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=33dd0e9a960ec1f73411ee7059c3beb8806fd328 |
||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Stéphane Thibaudeau
Created attachment 255649 [details]
Menu used to create a new user story
The previous update site contains the same versions I've been usiing for my tests. If it's not available you should probably reproduce the bug using this update site : http://marketplace.obeonetwork.com/updates/sirius2.0 Reproduced using the supplied data. New Gerrit change created: https://git.eclipse.org/r/54458 New Gerrit change created: https://git.eclipse.org/r/54459 Analysis of what happens:
* When the diagram is opened, many Acceleo expressions are evaluated in the context of the diagram. This evaluation requires the generation and compilation of in-memory MTL modules, both for the expressions themselves and for the services declared in the VSM. In particular, the VSM reference to the TaskUtils service class produces an MTL module with this signature:
[module org::obeonetwork::graal::design::services::task::TaskUtils('http://www.obeonetwork.org/dsl/graal/2.0.0','http://www.eclipse.org/sirius/diagram/1.1.0')]
which declares queries on all service methods in TaskUtils, using the special invoke() instruction. At this point, all the expressions (including the service modules) are in a context where at least one variable (e.g. "diagram") is instance of the http://www.eclipse.org/sirius/diagram/1.1.0 Sirius metamodel. The Sirius/A3 bridge sees this implied dependency, and correctly adds the diagram metamodel to the compilation context. The TaskUtils module compiles without errors, and everything goes fine.
* Then we open the table, which also evaluates Acceleo expressions, but in a different context. This time, none of the variables reference the diagram MM, so when the time comes to recompile the TaskUtils module, the signature used is
[module org::obeonetwork::graal::design::services::task::TaskUtils('http://www.obeonetwork.org/dsl/graal/2.0.0')]
This version does not compile, which results in a CompilationResult instance with many ERRORs in its status, but which is still put in the compiledModules cache. The table does not use this service, so its own refresh goes fine.
* When the table tool is invoked, its own execution goes fine too, but it changes the semantic model, which triggers a refresh on the diagram side. When the diagram expressions are evaluated, they find the erroneous CompilationResult in the cache, and use that despite its error status, instead of re-compiling the module in the current contect. This makes the resolution of the expression's AST fail; more precisely, when parsing the expression begin evaluated, the call to "source.resolveAST();" in AcceleoParser.parse(AcceleoSourceBuffer, Resource, List<URI>) produces a QuerySpec for "visibleTasks(DDiagram)" with expression == null, which causes the error seen in the error log.
The proposed fix is to backport the patches made for bug #461498 (fixed in 3.0), which always make all our dialects' metamodels available to the context of expression, including the Acceleo compilation context.
Gerrit change https://git.eclipse.org/r/54459 was merged to [v2.0.x]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=33dd0e9a960ec1f73411ee7059c3beb8806fd328 Fixed by 33dd0e9a960ec1f73411ee7059c3beb8806fd328. Validated with Sirius 2.0.7 (2.0.7.201611241521) Available in Sirius 2.0.7, see https://wiki.eclipse.org/Sirius/2.0.7. |