[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: OCL checker for EMF models in transformation chain

Ed Merks a écrit :
Damien,

Comments below.


Thanks!

Damien Thivolle wrote:
Hello,

I'm relatively new to Eclipse and the modeling technology. I want to write a transformation from a meta-model MMa to a meta-model MMb using ATL. The problem is that the transformation will only concern a subset of MMa.
There's a newsgroup for ATL. I've included it on the "to" list of the reply.

Thank you but I don't have any problems with ATL and I'm in close contact with the ATLAS team anyway.



I've been hinted to write a checker in OCL that would just tell me whether a model Ma (conforming to MMa) is included in the subset I'm interested in.


In the end, if the checker answers true when asked if the input model is correct, the transformation would take place, if not an error message would be yielded.

I've been looking for some clues as to where to start and I was expecting to find something suitable for a newbie like me. Like, I define a file with a set of OCL constraints, right click on my model and choose "Validate constraints from file...". But I guess it's not gonna be that easy.

More generally, I'm having a hard time finding my way around Eclipse, EMF and such... I've been reading all the material I could find about using OCL to check constraints on EMF models, and it's like Chinese to me.
Note really. If it were Chinese it would use an alphabet you'd not recognize. :-P

Yeah, sorry about my whining :) It's just that usually with Eclipse, the documentation gives you a lot of examples as starting points. But too often, there aren't enough explanations to make you really understand what you're doing (see the doc for the OCL environment class which takes 12 template parameters...).


For example, I've seen a lot of EMF models with annotations named "OCL" and having several entries, but I can't really find anything that would explain me what to do with those.
Did you look at the Eclipse help?

I'm just saying is that I find it hard to understand this technology and I'm wondering if it's normal or if this is where my comprehension reaches its limits.
There's an awful lot of technology to learn all at once for sure. And the documentation is sometimes a little lacking or hard to find...

My models are in files with a .sam extension and I want to write an ocl file with constraints for my models. The SAM meta-model is written in Ecore.


So I was thinking I could implement a contextual menu action that would only be available for files with a .sam extension. When handling that action, I would open that model file in JAVA as you explained in one of your previous messages on this newsgroup (<fmnq3n$qrm$1@xxxxxxxxxxxxxxxxx>). Then I would ask the user to choose an ocl file and would use the OCL Eclipse project to open that OCL file, parse it and verify the constraints on my SAM model. Does that sound alright or is there a better way to do it?

For now, I'll forget about the transformation chain, I'll implement the constraints checker and the ATL transformation separately and then, I will think about how to "connect" them.

Best regards,

--
Damien THIVOLLE                   |     INRIA Rhone-Alpes / VASY
PHD Student                       |     655, Avenue de l'Europe
damien.thivolle@xxxxxxxx          |     Montbonnot
http://www.inrialpes.fr/vasy      |     38 334 Saint Ismier Cedex France