Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » OCL metamodel constraint to ATL helper
OCL metamodel constraint to ATL helper [message #1752303] Fri, 20 January 2017 18:32 Go to next message
meriem lahr is currently offline meriem lahrFriend
Messages: 31
Registered: March 2013
Member
Hi all,

I'm writing an ATL higher order transformation to verify either a model conforms to a metamodel.

Please, does someone know how to translate the metamodel constraints writen in OCL into ATL? For example, for the class diagram metamodel, if a constraint asserts that two classes cannot have the same name, an ATL helper in this form should be created :

helper context CD!Class def: existSameName() : Boolean =
-- verification of the constraint

Thank you very much

Meriem
Re: OCL metamodel constraint to ATL helper [message #1752306 is a reply to message #1752303] Fri, 20 January 2017 19:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

ATL uses its own implementation that is OCL-like, but since it is independent you have no option of re-using models from another OCL. You will find it easiest to construct the required ATL as a text file and then parse it. You could try a M2M between an OCL AST and an ATL AST, but I would expect that you would find quite a few extra excitements.

Regards

Ed Willink

Re: OCL metamodel constraint to ATL helper [message #1752328 is a reply to message #1752306] Sat, 21 January 2017 15:54 Go to previous messageGo to next message
meriem lahr is currently offline meriem lahrFriend
Messages: 31
Registered: March 2013
Member
Hi Ed

Thanks a lot for your answer.

Excuse me, I did not understand what do you mean by I have no option of re-using models from another OCL

To avoid misunderstanding, I would like to give more details about my problem. My ATL higher order transformation takes only a UML metamodel as input and provides another ATL transformation. The output transformation should verify either a model conforms to the metamodel (input of the HOT) so it takes a model as input and a verification result as model as output. The issue is that since we have an access to the input metamodel in ATL HOT, and the well-formedness rules, written in OCL, are part of this metamodel, is there any way to access them?

Regards

Meriem
Re: OCL metamodel constraint to ATL helper [message #1752329 is a reply to message #1752328] Sat, 21 January 2017 17:04 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It is very difficult to provide helpful answers to vague questions. Without seeing what you really have, I can only repeat my previous answer. Use text. Interchangeable OCL is text.

Regards

Ed Willink
Previous Topic:[QVTo] how to use two target sources?
Next Topic:Assignment statement in ATL helpers
Goto Forum:
  


Current Time: Tue Apr 16 09:51:30 GMT 2024

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

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

Back to the top