Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Re: OCL checker for EMF models in transformation chain
Re: OCL checker for EMF models in transformation chain [message #73823] Tue, 29 January 2008 17:32 Go to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Damien,

Comments below.


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.
>
> 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
> 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...
>
> Best regards,
>
Re: [ATL] OCL checker for EMF models in transformation chain [message #74474 is a reply to message #73823] Tue, 05 February 2008 16:27 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello Damien,

Firstly, I added [ATL] as a prefix to the subject of this post because I
am answering from the ATL point of view :-).


Secondly, here is a possible approach to do what you described:

1- Write the OCL constraints as a transformation (e.g., in ATL). Source:
Ma, target: a diagnostic (e.g., a model containing the list of failed
constraints). Examples:
http://www.eclipse.org/m2m/atl/atlTransformations/#ATL2Probl em,
http://www.eclipse.org/m2m/atl/atlTransformations/#KM32Probl em,
http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt /org.eclipse.gmt.tcs/dsls/TCS/WFR/TCS2Problem.atl?view=marku p


2- Use a query to check if there are errors.


3- Run the actual transformation if there is no error.


2 and 3 are for instance used in the TCS compiler, at lines 122 to 142:
http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.gmt /org.eclipse.gmt.tcs/scripts/AMMAScripts/build.syntax.xml?vi ew=markup

Note that because we use TCS to parse the source model, we can apply
markers for the detected errors using the am3.applyMarkers task.


The TCS compiler that I mentioned above is implemented using the AM3 ant
tasks:
http://wiki.eclipse.org/AM3_Ant_Tasks

Note that it is also implemented as an Eclipse plugin. This means that
you can also implement such a scenario in Java.


Regards,

Frédéric Jouault


Ed Merks wrote:
> Damien,
>
> Comments below.
>
>
> 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.
>>
>> 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
>> 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...
>>
>> Best regards,
>>
Previous Topic:Modeling Map<>
Next Topic:[ATL] Called Rules Parameter Passing
Goto Forum:
  


Current Time: Fri Apr 26 05:35:01 GMT 2024

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

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

Back to the top