Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Issue with enum literals in aql conditions
Issue with enum literals in aql conditions [message #1777266] Mon, 27 November 2017 18:08 Go to next message
Pierre Gaufillet is currently offline Pierre GaufilletFriend
Messages: 20
Registered: September 2015
Junior Member
Hi Sirius team!

In a simple automaton metamodel I made as an example with Obeodesigner 10.1, the EClasse Port has an attribute typed by the EEnum PortDirection (possible values are INPUT_PORT and OUTPUT_PORT). When I try to add a conditional style on this attribute with condition:

aql:self.direction=automaton::PortDirection::INPUT_PORT


The condition is never true, and seems to cause silent errors (I have to close the modeling project and reopen it to get the graphical editor back working).
If I replace it by:

[self.direction=automaton::PortDirection::INPUT_PORT/]


Everything works fine. Am I missing something?

Thanks for your help!

Pierre

Re: Issue with enum literals in aql conditions [message #1777288 is a reply to message #1777266] Tue, 28 November 2017 08:09 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 162
Registered: July 2009
Senior Member
Hi Pierre,

It should work.
Could you try with aql:self.oclAsType(package::EClass).direction=automaton::PortDirection::INPUT_PORT

Regards,
Re: Issue with enum literals in aql conditions [message #1777299 is a reply to message #1777288] Tue, 28 November 2017 09:07 Go to previous messageGo to next message
Pierre Gaufillet is currently offline Pierre GaufilletFriend
Messages: 20
Registered: September 2015
Junior Member
Thanks for your answer Julien.

Your suggestion doesn't improve the situation, using neither oclAsType(automaton::Port) nor oclAsType(ecore:EClass).
Surprizingly, after a few more tests, it seems to work now, without modification!
But even on minor changes in the style condition, the viewpoint often gets disabled. Closing and reopening the projector restarting Eclipse is then the only way to get it working again.

Pierre
Re: Issue with enum literals in aql conditions [message #1777303 is a reply to message #1777299] Tue, 28 November 2017 09:36 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 162
Registered: July 2009
Senior Member
You must have problem elsewhere and this create a random behavior.
Re: Issue with enum literals in aql conditions [message #1777309 is a reply to message #1777303] Tue, 28 November 2017 10:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6614
Registered: July 2009
Senior Member
Hi

This kind of X not-equal-to X problem is often caused by metamodel schizophrenia. I have certainly reported related Acceleo bugs. You must make sure that you only have one variant of X. Always reference in the same way, e.g. as platform:/resource/my/x.ecore or only as http://my/X. Never mix the two in your models or in any model generated for you. If you allow your tool to load your metamodel twice with different URIs you can be in big trouble.

With Sirius you are probably always using OSGI and so most of the non-OSGI challenges that affect Acceleo should not affect you.

If you are also using Xtext you can use platform:/resource/ consistently after switching off the warnings in the project properties.

Regards

Ed Willink
Re: Issue with enum literals in aql conditions [message #1777841 is a reply to message #1777309] Tue, 05 December 2017 08:58 Go to previous messageGo to next message
Pierre Gaufillet is currently offline Pierre GaufilletFriend
Messages: 20
Registered: September 2015
Junior Member
Hi!

It seems indeed to be an example of what you described, Ed.

My metamodel is in the workspace and also deployed in Eclipse. When I close the meta-model project and restart Eclipse, the incorrect behaviour disappears. Declaring the correct meta-model (aka correct nsURI + platform:/plugin metamodel URI) in the Sirius diagram definition doesn't solve the issue.

Pierre
Re: Issue with enum literals in aql conditions [message #1777849 is a reply to message #1777841] Tue, 05 December 2017 09:55 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6614
Registered: July 2009
Senior Member
Hi

You have another serious problem. When running inside Eclipse, the global registries should be (lazily) populated by extension point registrations and should not change thereafter. It is unacceptable that running one program changes the behaviour of another. If you can identify the corrupting program please raise a Bugzilla. It should be using local registries.

Regards

Ed Willink
Previous Topic:Layering
Next Topic:Xtext and Sirius Integration: Talks, Slides and a White Paper
Goto Forum:
  


Current Time: Mon Mar 30 17:47:17 GMT 2020

Powered by FUDForum. Page generated in 0.05852 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top