Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » How to extend meta model via OCL?(adding operations...)
How to extend meta model via OCL? [message #670518] Sat, 14 May 2011 12:16 Go to next message
Kirsten M. Z. is currently offline Kirsten M. Z.
Messages: 131
Registered: July 2010
Senior Member
Hi @all,

could someone explain or post a link to a tutorial how to extend a meta model via OCL (without changing the meta model directly)?

I need M2T AND M2M in one of my projects. In both cases, I can call meta model functions (QVTo and Acceleo). Therefore, I add operations to the meta model whenever I need functionality in both transformations.

The sad thing: I can only add operations to my own meta model, but I want to add operations to UML::Element or UML::String as well. Of course, I don't want to touch the original UML meta model or recreate anything.

A collegue said that there should be a possibility to use OCL for that. Basically, inside QVTo and Acceleo code, this is possible as well. So it is an obvious question if this is a feature of OCL itself. Using the "context" for UML::Element (and body?) for adding an operation?

We haven't found an example and we have no idea where to embed such OCL definitions.

Thanks for help or comment!

Regards,
Kirsten

[Updated on: Sat, 14 May 2011 12:17]

Report message to a moderator

(no subject) [message #670521 is a reply to message #670518] Sat, 14 May 2011 12:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3842
Registered: July 2009
Senior Member
Hi Kirsten

You need a Complete OCL document to complement your UML (meta-)model.

In the past this has been available via the Java API as described in
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. ocl.doc/references/overview/parsingDocuments.html.
If you check out the Indigo variant you'll find a couple of significant
typos fixed.

The Helios OCL Examples add-on provided a Complete OCL editor that
worked against Ecore meta-models.

The Indigo OCL Examples add-on significantly enhances this so that it
also works for UML meta-models.

My EclipseCon tutorial
http://www.eclipsecon.org/2011/sessions/?page=sessions&i d=2271 showed
how Complete OCL could be used to complement an Ecore meta-model
allowing use during Xtext validation. In principle, if you use the RC1
Indigo release, you just change the import *.ecore to import *.uml.

The Indigo release of Papyrus will probably use a similar OCL editor for
OCL editing within UML diagrams.

The interactive OCL support for UML is very hot off the press, so don't
expect it to be perfect in Indigo; it is examples quality; release
quality will be achieved only in Juno.

Regards

Ed Willink



On 14/05/2011 17:16, forums-noreply@eclipse.org wrote:
> Hi @all,
>
> could someone explain or post a link to a tutorial how to
> extend a meta model via OCL?
>
> I need M2T AND M2M in one of my projects. In both cases, I
> can use call meta model functions (QVTo and Acceleo).
> Therefore, I add operations to the meta model whenever I
> need functionality in both transformations.
>
> The sad thing: I can only add operations to my own meta
> model, but I want to add operations to UML::Element or
> UML::String as well. Of course, I don't want to touch the
> original UML meta model or recreate anything.
>
> A collegue said that there should be a possibility to use
> OCL for that. Basically, inside QVTo and Acceleo code, this
> is possible as well. So it is an obvious question if this is
> a feature of OCL itself. Using the "context" for
> UML::Element (and body?) for adding an operation?
>
> We haven't found an example and we have no idea where to
> embed such OCL definitions.
>
> Thanks for help or comment!
>
> Regards,
> Kirsten
Re: (no subject) [message #670924 is a reply to message #670521] Mon, 16 May 2011 04:38 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.
Messages: 131
Registered: July 2010
Senior Member
Hello Ed,

thanks for your response.

Seems that CompleteOCL is exactly what I was looking for. However, I don't understand your slides completely regarding Acceleo and QVTo. I also have to admit that admit that I am not familiar with Xtext.

So just a concrete question. How does Acceleo and QVTo work with such CompleteOCL *.ocl files? And also very important for me: what to do in code for standalone applications, so using this technology without Eclipse (I already saw that things need a registry available in Eclipse and stuff). It was not trivial (and it is not well documented) to get Acceleo and QVTo working in a standalone environment. I expect something bad with CompleteOCL as well Wink

Best regards,
Kirsten
Re: (no subject) [message #670927 is a reply to message #670924] Mon, 16 May 2011 04:53 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3842
Registered: July 2009
Senior Member
Hi Kirsten

[please use a subject and give yourself a name.]

You are at/beyond the edge of what works with Complete OCL. Getting
Complete OCL fully working for UML is challenging. In principle with the
aid of OCL delegates, the functionmality could just drop into Acceleo or
QVTo, but it's never that simple.

If you are looking for a production ready solution; look elsewhere. I'm
not sure where since OCL tooling has been quite slow to evolve.

If you are prepared to share some pain in getting this working then this
will be beneficial to a variety of people.

Yes. Each tool has distinct standalone setups. For OCL you can look at
JUnit tests, or see what documentation I remember to enhance for Indigo.

On 16/05/2011 09:38, forums-noreply@eclipse.org wrote:
> Hello Ed,
>
> thanks for your response.
>
> Seems that CompleteOCL is exactly what I was looking for.
> However, I don't understand your slides completely
> regarding Acceleo and QVTo. I also have to admit that admit
> that I am not familiar with Xtext.
>
> So just a concrete question. How does Acceleo and QVTo work
> with such CompleteOCL *.ocl files? And also very important
> for me: what to do in code for standalone applications, so
> using this technology without Eclipse (I already saw that
> things need a registry available in Eclipse and stuff). It
> was not trivial (and it is not well documented) to get
> Acceleo and QVTo working in a standalone environment. I
> expect something bad with CompleteOCL as well ;)
>
> Best regards,
> Kirsten
Previous Topic:Re: Specifying constraints at Model Instance (M0) level
Next Topic:[Announce] Eclipse OCL 3.1.0 RC1 is available
Goto Forum:
  


Current Time: Thu Apr 17 17:35:39 EDT 2014

Powered by FUDForum. Page generated in 0.01666 seconds