How to extend meta model via OCL? [message #670518] |
Sat, 14 May 2011 16:16 |
Kirsten M. Z. Messages: 132 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 16:17] Report message to a moderator
|
|
|
(no subject) [message #670521 is a reply to message #670518] |
Sat, 14 May 2011 16:40 |
Ed Willink Messages: 7670 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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07621 seconds