Correct way to validate an .odesign [message #1830249] |
Wed, 22 July 2020 04:24 |
Leonardo Montecchi Messages: 10 Registered: September 2013 |
Junior Member |
|
|
Hello,
I am used to run the validation from the contextual menu on my models to verify that no hidden problems are there. However, I am not sure what is the correct way to do this with .odesign files.
If I use the "classical" validate menu I get some strange errors, in particular, when I use the "oclAsType" operation:
Nothing will be left after calling oclAsType:
EClassifier=Type is not compatible with type Set([email]org.eclipse.emf.ecore.impl.EClassImpl@5951d91[/email] (name: PrimitiveType) (instanceClassName: null) (abstract: false, interface: false)[email]org.eclipse.emf.ecore.impl.EClassImpl@3ce92d27[/email] (name: PrimitiveType) (instanceClassName: null) (abstract: false, interface: false)
What does this error mean exactly? My editor works as expected, but it seems the validator always assumes that the "oclAsType" operation will return null. In this case the involved metaclasses are "Type" and "PrimitiveType". The latter is indeed subclass of the former, so the cast is possible, and, as mentioned, the expression works correctly in runtime.
I have explicitly added the metamodel to the odesign file and as a dependency to the plugin.
Thanks,
Leonardo.
Leonardo Montecchi
Instituto de Computação, UNICAMP
http://ic.unicamp.br/~leonardo
http://laser.ic.unicamp.br/
[Updated on: Wed, 22 July 2020 04:25] Report message to a moderator
|
|
|
|
|
|
Re: Correct way to validate an .odesign [message #1830357 is a reply to message #1830321] |
Fri, 24 July 2020 02:18 |
Leonardo Montecchi Messages: 10 Registered: September 2013 |
Junior Member |
|
|
Hello Ed,
thank you for your time and for the suggestions.
Maybe I was not clear in my question, but I am talking about design time. I am specifying the editor with Sirius, and when I validate the editor it gives that error. So there is no instance element to check, and to run the debug as you suggest I think I would need to run the source code of Sirius in debug mode.
At runtime the editor works without errors, but the validation of the editor does not pass. It may have to do with Sirius not supporting complex expressions as you said. I found that transforming the element to a Sequence, then using the "->filter()" operation and then taking "->first()" works, but there must be a better solution. (it seems that "->filter()" is the cast operation in Sirius).
Regards,
Leonardo.
Leonardo Montecchi
Instituto de Computação, UNICAMP
http://ic.unicamp.br/~leonardo
http://laser.ic.unicamp.br/
[Updated on: Fri, 24 July 2020 02:19] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03083 seconds