Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AQLInterpreter: An error has occurred with the expression 'var:element': Couldn't find the 'element' variable #408

Closed
4 tasks done
mt-empty opened this issue Mar 24, 2021 · 3 comments · Fixed by #410
Closed
4 tasks done
Assignees
Milestone

Comments

@mt-empty
Copy link

mt-empty commented Mar 24, 2021

  • I have checked that this bug has not yet been reported by someone else

  • I have checked that this bug appears on Chrome

  • I have specified the version : master

  • I have specified my environment : Linux 64bit

Screenshots

I have a simple Metamodel with only a single [1..*] relation A--->B.
My delete edge functionality work fine in Sirius Desktop, but doesn't work properly in Sirius-web, It deletes all edges outgoing from A instead of just the selected one.

This is my delete functionality
image

This is the error that I get when I delete an edge on sirius-web.

2021-03-25 00:35:50.407 DEBUG 772177 --- [f7-060f65e129ef] .w.s.c.d.h.DeleteFromDiagramEventHandler : Deleted diagram edge 30406932-f537-3d34-90fa-0b4444a39e1b
2021-03-25 00:35:50.408 ERROR 772177 --- [f7-060f65e129ef] o.e.s.web.interpreter.AQLInterpreter     : An error has occurred with the expression 'var:element': Couldn't find the 'element' variable
2021-03-25 00:35:50.412 ERROR 772177 --- [f7-060f65e129ef] o.e.s.web.interpreter.AQLInterpreter     : An error has occurred with the expression 'aql:elementView.targetNode.target': Couldn't find the 'elementView' variable

This is my MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: se.project.design;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: se.project.design.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime,
 org.eclipse.core.resources,
 org.eclipse.sirius,
 org.eclipse.sirius.common.acceleo.aql,
 dsvl.se;bundle-version="0.1.0",
 org.eclipse.sirius.properties;bundle-version="6.1.3",
 org.eclipse.sirius.ui.properties;bundle-version="6.1.3"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Vendor: %providerName
Automatic-Module-Name: se.project.design
Export-Package: se.project.design

Expected behaviour

Deletes the selected edge.

Actual behaviour

Deletes all edges outgoing from A.
...

@pcdavid
Copy link
Member

pcdavid commented Mar 24, 2021

Thanks for the feedback.
In Sirius Desktop, the elementView variable (and all the *View variables actually) point to elements in the Sirius EMF model for diagrams (DDiagram and related). These do not exist in the same form in Sirius Web, so we do not provide the corresponding variable.
The most common use case for elementView, like yours, is to get the semantic elements at the source or target of the edge.
For this we provide the semanticEdgeSource and semanticEdgeTarget variables instead, which can replace the expressions element.sourceNode.target and element.targetNode.target.
You can uses these in your Element Expression and it should work in Sirius Web, but unfortunately it will stop working in Sirius Desktop (which does not provide this variable, at least at the time).

@pcdavid
Copy link
Member

pcdavid commented Mar 24, 2021

If we want to improve compatibility between Sirius Desktop and Sirius Web on this kind of stuff, I see two options:

  1. in Sirius Web, "cheat" and provide the Desktop variables as fake objects which respond to the same kind of queries (e.g. here expose a target attribute which points to the semantic element). This would need quite a lot of work and would probably be very brittle.
  2. in Sirius Desktop, add the same variables as mentioned above (semanticEdgeSource and semanticEdgeTarget), and maybe others as needed. This depends on what people are actually doing with elementView & co. in their VSMs: progressively identify the most common (and "legitimate") usage patterns/expressions, and expose the result of the expressions directly as variables that can be available in both versions of Sirius. At some point we could deprecate the direct *View variables in Sirius Desktop if we are confident we support all the legitimate use cases with more direct variables.

They are not incompatible but the second option seems preferable in the long term.

pcdavid added a commit that referenced this issue Mar 24, 2021
Bug: #408
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Mar 24, 2021
Bug: #408
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Mar 24, 2021
Fixes #408.

Bug: #408
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@pcdavid
Copy link
Member

pcdavid commented Mar 24, 2021

To be clear, my remarks above were only about the elementView variable/
The element variable is indeed missing. This should be fixed by PR #410 .

@pcdavid pcdavid self-assigned this Mar 24, 2021
@sbegaudeau sbegaudeau linked a pull request Apr 12, 2021 that will close this issue
1 task
sbegaudeau pushed a commit that referenced this issue Apr 12, 2021
Fixes #408.

Bug: #408
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@sbegaudeau sbegaudeau added this to the 0.3.0 milestone Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants