Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Sharing OCL operation definitions in Acceleo/QVTo
Sharing OCL operation definitions in Acceleo/QVTo [message #1017150] Sat, 09 March 2013 22:10 Go to next message
Filip Krikava is currently offline Filip KrikavaFriend
Messages: 45
Registered: January 2012
Member
Hi,

Perhaps I should ask this question in both Acceleo/QVT forums, but I'll try here first.
Is is possible to reuse an operation definition from Complete OCL in Acceleo/QVTo?

I mean, in complete OCL I will have something like:

import uml : 'http://www.eclipse.org/uml2/4.0.0/UML#/'

context uml::Element

def: hasStereotype(name : String) : Boolean = 
  self.getAppliedStereotypes()->exists(st|st.name = name)


and then can I somehow refer to this hasStereotype from Acceleo and QVTo? If not, are there any plans to support it?

Thanks a lot!
Filip

[Updated on: Sat, 09 March 2013 22:10]

Report message to a moderator

Re: Sharing OCL operation definitions in Acceleo/QVTo [message #1017165 is a reply to message #1017150] Sun, 10 March 2013 11:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Simple answer: No.

-----

One possible solution is to exploit a Complete OCL merger so that
existing tools just load the merged metamodel.

The functionality for this is in org.eclipse.ocl.examples.build and is
used while generating Pivot.ecore from Pivot.cmof plus Pivot.ocl.

-----

You've forced me to clarify my thoughts a bit.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402830 raised. OMG Issue
also raised.

In order for a UML model to import some Complete OCL for use in the
model's constraints, a Complete OCL document must be a (derived)
Package. Any tool can therefore import Complete OCL using its
conventional metamodel import syntax; just needs per-tool support.

Complete OCL documents must not conflict. For instance if MM imports
COD1 for its own purposes and then your usage imports MM (and COD1) and
also COD2, the declarations in COD2 may not introduce anything that
requires re-analysis of the OCL expressions in MM or COD1; the only
change to MM+COD1 execution may arise through additional derived virtual
functions.

OCL and QVTc and QVTr already share the same Xtext parser and
Pivot-based analysis. QVTo is migrating to this too, so the same basic
support can be available in throughout. Once the Pivot-based support is
mature, Acceleo too might migrate to gain the benefits of modularization
and code generation.

Regards

Ed Willink


On 09/03/2013 22:10, Filip Krikava wrote:
> Hi,
>
> Perhaps I should ask this question in both Acceleo/QVT forums, but
> I'll try here first.
> Is is possible to reuse an operation definition from Complete OCL in
> Acceleo/QVTo?
>
> I mean, in complete OCL I will have something like:
>
>
> import uml : 'http://www.eclipse.org/uml2/4.0.0/UML#/'
>
> context uml::Element
>
> def: hasStereotype(name : String) : Boolean =
> self.getAppliedStereotypes()->exists(st|st.name = name)
>
>
> and then can I somehow refer to this hasStereotype from Acceleo and
> QVTo? If not, are there any plans to support it?
> Thanks a lot!
> Filip
Previous Topic:cannot get tutorial to create error
Next Topic:transform completeocl resource
Goto Forum:
  


Current Time: Tue Apr 23 10:44:48 GMT 2024

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

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

Back to the top