Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Adding OCL in a Ecore Metamodel(Adding OCL in a Ecore Metamodel)
Adding OCL in a Ecore Metamodel [message #510994] Fri, 29 January 2010 13:26 Go to next message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
Hi everyone!. I'm trying to add OCL for specify restrictions and derived references in my ecore metamodel (the mindmap). I'm reading the book Eclipse Modeling Project: A domain specific language toolkit. In Chapter 3, Gronback show how do this activity. The problem is I have done and review the book twice and Eclipse not generate the JET templates in the templates folder and the code derived from the OCL Statements in the class implementation. I checked the source and its the tutorial: Christian W. Damus, "Implementing Model Integrity in EMF with MDT OCL. Well, I tried do it whit the Eclipse modeling project version and the modeling version of Eclipse (both Galileo) and in the two cases it doesn't work. Can somebody tell me how to add OCL in the Ecore metamodel in these versions?

PS: I read anothers post with the same problem but I don't find any solution in the order to solve this problem. Is important for me, because I have to develop a plugin's series in the form of UML profiles for a specific language to represent collaborative business processes models between business partners and I must to implement restrictions in the differents metamodels using OCL


[Updated on: Fri, 29 January 2010 21:03]

Report message to a moderator

Re: Adding OCL in a Ecore Metamodel [message #511740 is a reply to message #510994] Tue, 02 February 2010 17:00 Go to previous messageGo to next message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
I solve the problem. I looked for the samples of the book wich were in the org.eclipse.amalgam.examples.dsltk plugin and then I imported the mindmap example whitin the workspace and copy and paste the jet templates into my project. I think the templates from the tutorial are obsolote
Re: Adding OCL in a Ecore Metamodel [message #511756 is a reply to message #511740] Tue, 02 February 2010 18:07 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

--=-X5L2viIqIB1HPlV6ENfo
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Fernando,

The article isn't obsolete: it still works just fine with EMF 2.3! :-P

It does happen to illustrate one of the risks inherent in using custom
templates, though: as EMF's generator framework evolves, one's custom
templates do need to be updated to pick up changes from the EMF
templates that they replace. The EMF team does a good job of ensuring
that its supported extension and override points continue to work, but
can't really do anything to help people like me who completely replace
the base templates.

Perhaps you'd like to help complete the more modern solution proposed in
http://bugs.eclipse.org/191689 ?

Cheers,

Christian


On Tue, 2010-02-02 at 12:00 -0500, Fernando Herrera wrote:

> I solve the problem. I looked for the samples of the book wich were in the org.eclipse.amalgam.examples.dsltk plugin and then I imported the mindmap example whitin the workspace and copy and paste the jet templates into my project. I think the templates from the tutorial are obsolote

--=-X5L2viIqIB1HPlV6ENfo
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Fernando,<BR>
<BR>
The article isn't obsolete:&nbsp; it still works just fine with EMF 2.3!&nbsp; :-P<BR>
<BR>
It does happen to illustrate one of the risks inherent in using custom templates, though:&nbsp; as EMF's generator framework evolves, one's custom templates do need to be updated to pick up changes from the EMF templates that they replace.&nbsp; The EMF team does a good job of ensuring that its supported extension and override points continue to work, but can't really do anything to help people like me who completely replace the base templates.<BR>
<BR>
Perhaps you'd like to help complete the more modern solution proposed in http://bugs.eclipse.org/191689 ?<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Tue, 2010-02-02 at 12:00 -0500, Fernando Herrera wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
I solve the problem. I looked for the samples of the book wich were in the org.eclipse.amalgam.examples.dsltk plugin and then I imported the mindmap example whitin the workspace and copy and paste the jet templates into my project. I think the templates from the tutorial are obsolote
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-X5L2viIqIB1HPlV6ENfo--
Re: Adding OCL in a Ecore Metamodel [message #511785 is a reply to message #511756] Tue, 02 February 2010 20:29 Go to previous messageGo to next message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
Cristian,

I'm beginner in EMF, OCL and GMF so I thought that the templates doesn't work with my target EMF version (2.5) like you said. Maybe the word "obsolete" wasn't right. I don't remember if I test the templates of the article setting the genmodel on the EMF version 2.3 before regeneration!... I appreciate your invitation and I will post in a while!. I'm a MDA enthusiastic and I think that these frameworks are very productive and are aligned directly with the MDA approach so while I work in my project degree, I will share in these forums, all that I learn and I will post questions in order to solve problems that surely I will find!

Cheers!

Fernando





Re: Adding OCL in a Ecore Metamodel [message #511829 is a reply to message #511785] Wed, 03 February 2010 06:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Fernando, Christian

https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689 has just sprung
back to life with the 3.6M6 API change deadline looming. Support for
the new way of doing OCL constraints will appear in MDT/OCL CVS in the
next week or two and will be available in the Eclipse M6 milestone and
subsequently the Helios release.

I'm sorry that in the interim the solutions are poorly described.

Regards

Ed Willink


On 02/02/2010 20:29, Fernando Herrera wrote:
> Cristian,
>
> I'm beginner in EMF, OCL and GMF so I thought that the templates doesn't
> work with my target EMF version (2.5) like you said. Maybe the word
> "obsolete" wasn't right. I don't remember if I test the templates of the
> article setting the genmodel on the EMF version 2.3 before
> regeneration!... I appreciate your invitation and I will post in a
> while!. I'm a MDA enthusiastic and I think that these frameworks are
> very productive and are aligned directly with the MDA approach so while
> I work in my project degree, I will share in these forums, all that I
> learn and I will post questions in order to solve problems that surely I
> will find!
>
> Cheers!
>
> Fernando
>
>
>
>
>
>
Re: Adding OCL in a Ecore Metamodel [message #511958 is a reply to message #511829] Wed, 03 February 2010 14:32 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

--=-y67yr2zACHJGnNBz6qFz
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Ed,

Many thanks to you and Kenn for working so diligently on this. The
prospect of finally having a complete validation solution in Ecore is
very exciting! And no less exciting is parity of dynamic Ecore's
capabilities with generated models.

Cheers,

Christian


On Wed, 2010-02-03 at 06:42 +0000, Ed Willink wrote:

> Hi Fernando, Christian
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689 has just sprung
> back to life with the 3.6M6 API change deadline looming. Support for
> the new way of doing OCL constraints will appear in MDT/OCL CVS in the
> next week or two and will be available in the Eclipse M6 milestone and
> subsequently the Helios release.
>
> I'm sorry that in the interim the solutions are poorly described.
>
> Regards
>
> Ed Willink
>
>
> On 02/02/2010 20:29, Fernando Herrera wrote:


--------8<--------

--=-y67yr2zACHJGnNBz6qFz
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Ed,<BR>
<BR>
Many thanks to you and Kenn for working so diligently on this.&nbsp; The prospect of finally having a complete validation solution in Ecore is very exciting!&nbsp; And no less exciting is parity of dynamic Ecore's capabilities with generated models.<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Wed, 2010-02-03 at 06:42 +0000, Ed Willink wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi Fernando, Christian

<A HREF="https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689">https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689</A> has just sprung
back to life with the 3.6M6 API change deadline looming. Support for
the new way of doing OCL constraints will appear in MDT/OCL CVS in the
next week or two and will be available in the Eclipse M6 milestone and
subsequently the Helios release.

I'm sorry that in the interim the solutions are poorly described.

Regards

Ed Willink


On 02/02/2010 20:29, Fernando Herrera wrote:
</PRE>
</BLOCKQUOTE>
<BR>
--------8&lt;--------
</BODY>
</HTML>

--=-y67yr2zACHJGnNBz6qFz--
Re: Adding OCL in a Ecore Metamodel [message #511959 is a reply to message #511958] Wed, 03 February 2010 14:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040108050409040403090903
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Christian,

Yes, it's yet another fairly well hidden gem in the collection of crown
jewels. :-P


Christian W. Damus wrote:
> Hi, Ed,
>
> Many thanks to you and Kenn for working so diligently on this. The
> prospect of finally having a complete validation solution in Ecore is
> very exciting! And no less exciting is parity of dynamic Ecore's
> capabilities with generated models.
>
> Cheers,
>
> Christian
>
>
> On Wed, 2010-02-03 at 06:42 +0000, Ed Willink wrote:
>> Hi Fernando, Christian
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689 has just sprung
>> back to life with the 3.6M6 API change deadline looming. Support for
>> the new way of doing OCL constraints will appear in MDT/OCL CVS in the
>> next week or two and will be available in the Eclipse M6 milestone and
>> subsequently the Helios release.
>>
>> I'm sorry that in the interim the solutions are poorly described.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 02/02/2010 20:29, Fernando Herrera wrote:
>>
>
> --------8<--------

--------------040108050409040403090903
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christian,<br>
<br>
Yes, it's yet another fairly well hidden gem in the collection of crown
jewels. :-P<br>
<br>
<br>
Christian W. Damus wrote:
<blockquote cite="mid:1265207545.7091.33.camel@cdamus-laptop"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="GENERATOR" content="GtkHTML/3.24.1.1">
Hi, Ed,<br>
<br>
Many thanks to you and Kenn for working so diligently on this.  The
prospect of finally having a complete validation solution in Ecore is
very exciting!  And no less exciting is parity of dynamic Ecore's
capabilities with generated models.<br>
<br>
Cheers,<br>
<br>
Christian<br>
<br>
<br>
On Wed, 2010-02-03 at 06:42 +0000, Ed Willink wrote:
<blockquote type="CITE">
<pre>Hi Fernando, Christian

<a moz-do-not-send="true"
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689">https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689</a> has just sprung
back to life with the 3.6M6 API change deadline looming. Support for
the new way of doing OCL constraints will appear in MDT/OCL CVS in the
next week or two and will be available in the Eclipse M6 milestone and
subsequently the Helios release.

I'm sorry that in the interim the solutions are poorly described.

Regards

Ed Willink


On 02/02/2010 20:29, Fernando Herrera wrote:
</pre>
</blockquote>
<br>
--------8&lt;--------
</blockquote>
</body>
</html>

--------------040108050409040403090903--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Adding OCL in a Ecore Metamodel [message #517424 is a reply to message #511829] Sat, 27 February 2010 17:30 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Fernando, Christian

The OCL-in-Ecore support is now in CVS HEAD ready to appear in MDT/OCL
3.0.0M6. The associated OCL-in-Ecore Editor and the OCL Document Editor
will be committed as OCL Examples over the next few weeks.

A first attempt at documentation is available at
http://wiki.eclipse.org/MDT/OCLinEcore Comments welcome.

Regards

Ed Willink


On 03/02/2010 06:42, Ed Willink wrote:
> Hi Fernando, Christian
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=191689 has just sprung
> back to life with the 3.6M6 API change deadline looming. Support for
> the new way of doing OCL constraints will appear in MDT/OCL CVS in the
> next week or two and will be available in the Eclipse M6 milestone and
> subsequently the Helios release.
>
> I'm sorry that in the interim the solutions are poorly described.
>
> Regards
>
> Ed Willink
Re: Adding OCL in a Ecore Metamodel [message #525564 is a reply to message #510994] Tue, 06 April 2010 21:43 Go to previous messageGo to next message
Jesse is currently offline JesseFriend
Messages: 5
Registered: April 2010
Junior Member
Hi, Fernando Herrera

I am new on OCL in Ecore. I am using EMF 2.5, trying to generate src for my ocl annotations added into ecore model. I just fail to get the expected results. OCL contraints are never integrated into the generated code. I think the dynamic templates should be the issue. Can you tell me your solutions. What are the correct templates that works for EMF 2.5?

Yan Liang
Re: Adding OCL in a Ecore Metamodel [message #525567 is a reply to message #525564] Tue, 06 April 2010 22:00 Go to previous message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
Hi, Yan Liang. Well, there are two ways to do the templates work. One is reading this article: http:// www.eclipse.org/articles/article.php?file=Article-EMF-Codege n-with-OCL/index.html . The templates provided work fine with EMF 2.3, so before generate the plugin's code in the genmodel file, set the EMF version at 2.3 and after that the code would be injected. The other way (in order to use the EMF 2.5 version), is with a set of different templates that I have. If you want them, please send me a email at: enferx@hotmail.com.

PS: The new version of Eclipse (3.6, Helios) upcoming will have this feature integrated in the GUI so you won't need to use templates for this work anymore.

Regards

Fernando

Previous Topic:[Announce] MoDELS 2010 Call for Papers
Next Topic:Re: [OCLinEcore] Calling operations within constraints
Goto Forum:
  


Current Time: Wed Apr 24 20:44:15 GMT 2024

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

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

Back to the top