3

I'm making a translation model on Magicdraw/Cameo between two metamodels, using several metamodels in its environment. This model contains OCL expressions, and I would like to use Eclipse to check the syntax of the OCL expressions of my model (I don't know if there is a better alternative, but this is where I hope to be able to import my project, evaluate the OCL expressions of my whole model and edit the OCL parser).

Eclipse Papyrus seems to be a good environment. I imported all my models and profile in a papyrus project and opened the Validity View (Validity View Eclipse).

My model respects the following structure :

enter image description here

and I want to make sure that all the OCL expressions of the model are correct. I tried to validate it with the Validity View, but it raise the following exception :

XMIException: UMLIdResorlver.getASOf failed for an org.eclipse.ocl.pivotElement ParserException: Failed to load 'platform/resource/projectName/MyClass.uml.oclas' : Inheritance loop for IllegalStateException: Inheritance loop for

I guess it may be related to the import of the model from Cameo/MagicDraw. Or maybe I misunderstood what the tool is supposed to do.

I want to make sure that my process makes sense, and understand how to achieve what I want with eclipse/papyrus or maybe a more adapted tool.

Thanks for your answers!

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
Kaly
  • 51
  • 3
  • The Validity View can be really really slow with UML unless you take care to exclude validation of UML itself. You might prefer to use Validate in Papyrus, or OCL->Validate within the UML Model Editor. – Ed Willink May 09 '23 at 17:54
  • @EdWillink thank you for your answer again! I don't know why but the OCL > Validate action is impossible (grayed out button) what could be the reason? Also, when I try to 'Validate' by right clicking on the root of my model I also get a whole series of errors like "Named Element ' Model' is not owned by a namespace, but it has visibility" – Kaly May 11 '23 at 09:40
  • It seems likely that your Cameo model has not been compatibly exported and imported so that what you are seeing is over detailed diagnosis of garbage. Use the UML Model Editor to Validate your UML. Without a repro it is hard to help further. Your example 'structure' is of course infected with many errors; it is not clear which are editorial convenience and which are genuine problems. – Ed Willink May 11 '23 at 15:13
  • @EdWillink I see thank you for your answer ! I'm indeed not sure how I should export my models. I have a model and its projects usage exported to Cameo with the file extension '.uml', what is the right way to export it to Eclipse? For my part I imported my model and its dependencies via Import > File System – Kaly May 15 '23 at 12:27
  • The Eclipse Forums have many threads on import/export. As an Eclipse user watching from a distance, it never ceases to amaze me how non-standard UML XMI interchange is. Without a repro to look at, I cannot help beyond suggesting that you compare the XMI of an Eclipse *.uml file with that of a Cameo *.uml file. – Ed Willink May 16 '23 at 07:41

1 Answers1

2

You have unfortunately truncated the error message, perhaps to preserve proprietary content. The "Inheritance loop for" should be followed by a list of the classes that form the inheritance loop. User-inheritance must be a forest and once OCL has injected OclAny and OclElement, OCL-inheritance must be a tree. You should be able to see one class that is wrong and so denotes a user error. It is of course possible that it is a bug in the UML2AS OCL normalization, in which case you may wish to file a bug report.

Ed Willink
  • 1,205
  • 7
  • 8
  • Thank you for your answer ! Unfortunately this is the error message I get and it is not truncated. I guess I'll have to fill a bug report indeed. – Kaly May 11 '23 at 09:28