Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Re: Reference to ExpressionInOCL
Re: Reference to ExpressionInOCL [message #62188] Fri, 12 September 2008 13:16 Go to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, W.F.,

This seems like a question more appropriate to the OCL newsgroup, which
I've included in my reply.

The UML binding for OCL (OCLUML.ecore) requires the abstract OCL
metamodel (OCL.ecore), so you need to reference its genmodel, also.

It may be worth noting that you will get more out of the UML binding for
OCL if you develop your metamodel with MDT UML2 instead of Ecore. For
example, UML semantics such as associations.

An important caveat: the serialization of OCL expressions (the AST) is
incomplete as defined by the OCL specification, particularly in the area
of references to dynamically-generated types such as collections and to
additional feature definitions. Simply including an ExpressionInOcl in
your metamodel will not be sufficient to persist OCL expressions. You
will also have to find containers for other objects that the MDT OCL
implementation's Environment persists in a special resource. Possibly
an annotation on the ExpressionInOcl would be appropriate.

HTH,

Christian


W.F. wrote:
> I need to create a reference to an ExpressionInOCL -> OpaqueExpression,
> ExpressionInOCL<Classifier, Parameter> in my domain ecore model.
> To do this I load the
> platform:/plugin/org.eclipse.ocl.uml/model/OCLUML.ecore resource.
> But when I try to reload the genmodel, first I'm getting errors:
> "The package 'platform:/plugin/org.eclipse.ocl/model/OCL.ecore#//types'
> is needed but not accessible from the Generator model."
> same for //utilities and //expressions.
>
> And then if I igonre these errors and try to Generate All, I'm getting
> many package import problems in the generated projects.
>
> What could be wrong?
>
Re: Reference to ExpressionInOCL [message #62212 is a reply to message #62188] Fri, 12 September 2008 14:00 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: July 2009
Junior Member
Christian W. Damus wrote:


> The UML binding for OCL (OCLUML.ecore) requires the abstract OCL
> metamodel (OCL.ecore), so you need to reference its genmodel, also.

Yes, this adds itself as platform:/plugin/org.eclipse.ocl/model/OCL.ecore
along with the OCLUML.ecore.

> It may be worth noting that you will get more out of the UML binding for
> OCL if you develop your metamodel with MDT UML2 instead of Ecore. For
> example, UML semantics such as associations.

I only have a few of such references. For example references to Operation
work OK, now I tried something from MDT OCL (ExpressionInOCL) and this
doesn't.

I thought I didn't have to worry about serialization because I'm only
using a reference to an element (ExpressionInOCL) that is already
persistent in another model.

I tried to manually fix the imports and dependencies in the projects
generated by GMF. But some packages are still missing, for example:
org.eclipse.ocl.edit
org.eclipse.ocl.expressions.provider
org.eclipse.ocl.types.provider

Are these part of the MDT OCL plugin?



> Hi, W.F.,

> This seems like a question more appropriate to the OCL newsgroup, which
> I've included in my reply.

> The UML binding for OCL (OCLUML.ecore) requires the abstract OCL
> metamodel (OCL.ecore), so you need to reference its genmodel, also.

> It may be worth noting that you will get more out of the UML binding for
> OCL if you develop your metamodel with MDT UML2 instead of Ecore. For
> example, UML semantics such as associations.

> An important caveat: the serialization of OCL expressions (the AST) is
> incomplete as defined by the OCL specification, particularly in the area
> of references to dynamically-generated types such as collections and to
> additional feature definitions. Simply including an ExpressionInOcl in
> your metamodel will not be sufficient to persist OCL expressions. You
> will also have to find containers for other objects that the MDT OCL
> implementation's Environment persists in a special resource. Possibly
> an annotation on the ExpressionInOcl would be appropriate.

> HTH,

> Christian
Re: Reference to ExpressionInOCL [message #62236 is a reply to message #62212] Fri, 12 September 2008 14:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, W.F.,

See some replies in-line, below.

HTH,

Christian

W.F. wrote:
> Christian W. Damus wrote:
>
>
>> The UML binding for OCL (OCLUML.ecore) requires the abstract OCL
>> metamodel (OCL.ecore), so you need to reference its genmodel, also.
>
> Yes, this adds itself as
> platform:/plugin/org.eclipse.ocl/model/OCL.ecore along with the
> OCLUML.ecore.
>
>> It may be worth noting that you will get more out of the UML binding
>> for OCL if you develop your metamodel with MDT UML2 instead of Ecore.
>> For example, UML semantics such as associations.
>
> I only have a few of such references. For example references to
> Operation work OK, now I tried something from MDT OCL (ExpressionInOCL)
> and this doesn't.
>
> I thought I didn't have to worry about serialization because I'm only
> using a reference to an element (ExpressionInOCL) that is already
> persistent in another model.

Well, that depends on whether your reference is a containment or not.
If not, then presumably persistence of the OCL is somebody else's
problem, as you say. :-)


> I tried to manually fix the imports and dependencies in the projects
> generated by GMF. But some packages are still missing, for example:
> org.eclipse.ocl.edit
> org.eclipse.ocl.expressions.provider
> org.eclipse.ocl.types.provider
>
> Are these part of the MDT OCL plugin?

Odd that GMF should require these plug-ins. In general, the reflective
item providers supplied by EMF automatically should be sufficient for
GMF's needs.

OCL currently does not deploy these because we would not customize them
beyond what the reflective provider does, anyway, and the code bloat
wasn't justified by the OCL porser's primary use case, which is parsing,
not EMF/GMF-generated editing of the AST.

However, I am intending in this release to provide an extra download for
those that want it that includes these plug-ins for all three OCL layers
(generic AST, Ecore, and UML). Until then, you can find Ed Willink's
generation of these plug-ins in the M2M QVTr component's CVS.

>
>> Hi, W.F.,
>
>> This seems like a question more appropriate to the OCL newsgroup,
>> which I've included in my reply.
>
>> The UML binding for OCL (OCLUML.ecore) requires the abstract OCL
>> metamodel (OCL.ecore), so you need to reference its genmodel, also.
>
>> It may be worth noting that you will get more out of the UML binding
>> for OCL if you develop your metamodel with MDT UML2 instead of Ecore.
>> For example, UML semantics such as associations.
>
>> An important caveat: the serialization of OCL expressions (the AST)
>> is incomplete as defined by the OCL specification, particularly in the
>> area of references to dynamically-generated types such as collections
>> and to additional feature definitions. Simply including an
>> ExpressionInOcl in your metamodel will not be sufficient to persist
>> OCL expressions. You will also have to find containers for other
>> objects that the MDT OCL implementation's Environment persists in a
>> special resource. Possibly an annotation on the ExpressionInOcl would
>> be appropriate.
>
>> HTH,
>
>> Christian
>
>
>
Re: Reference to ExpressionInOCL [message #62260 is a reply to message #62236] Fri, 12 September 2008 14:46 Go to previous message
No real name is currently offline No real nameFriend
Messages: 16
Registered: July 2009
Junior Member
OK, because I'm trying to do something rather simple here, I guess I can
reference a parent node of the ExpressionInOCL and then look for it by
hand. The parent will be from MDT UML (Value Pin or Value Specification
Action).
Thanks for your help.
Previous Topic:[Announce] MDT OCL 1.3.0 I200809101756 is available
Next Topic:Calling methods with more than one parameter
Goto Forum:
  


Current Time: Fri Apr 26 08:24:20 GMT 2024

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

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

Back to the top