Home » Modeling » OCL » Re: Reference to ExpressionInOCL
Re: Reference to ExpressionInOCL [message #62188] |
Fri, 12 September 2008 13:16 |
Eclipse User |
|
|
|
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 |
No real name 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 |
Eclipse User |
|
|
|
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
>
>
>
|
|
| |
Goto Forum:
Current Time: Thu Nov 14 08:07:48 GMT 2024
Powered by FUDForum. Page generated in 0.03393 seconds
|