Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsIssue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777266/#msg_1777266
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:
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:
]]>Pierre Gaufillet2017-11-27T18:08:46-00:00Re: Issue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777288/#msg_1777288
It should work.
Could you try with aql:self.oclAsType(package::EClass).direction=automaton::PortDirection::INPUT_PORT
Regards,]]>Julien Dupont2017-11-28T08:09:38-00:00Re: Issue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777299/#msg_1777299
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]]>Pierre Gaufillet2017-11-28T09:07:27-00:00Re: Issue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777303/#msg_1777303
Julien Dupont2017-11-28T09:36:25-00:00Re: Issue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777309/#msg_1777309
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]]>Ed Willink2017-11-28T10:06:41-00:00Re: Issue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777841/#msg_1777841
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]]>Pierre Gaufillet2017-12-05T08:58:14-00:00Re: Issue with enum literals in aql conditions
https://www.eclipse.org/forums/index.php/mv/msg/1090272/1777849/#msg_1777849
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.