Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL for UML2
OCL for UML2 [message #56977] Wed, 28 May 2008 09:12 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hi all,

i have to use OCL for a (relatively) simple class model, created with uml2
class-diagram editor. This is a both a valid ecore model and a valid uml2
model, since uml2 is based or implemented on/with Ecore? So far, so good.

Now, i want to use OCL for adding some constraints to my class diagram. This
is not realy complicated, but evaluating this by the OCL plugin from eclipse
is. So my question: Do I need the org.eclipse.ocl.ecore or the
org.eclipse.ocl.uml plugin for evaluating OCL against the uml2 metamodel?
Because, every uml2 classifier is of course a EClassifier? Is the
ecore-plugin exclusively for user-defined ecore meta-models and their
instances?

This is a bit confusing.

Thanks a lot for any hint

Timothy
Re: OCL for UML2 [message #57085 is a reply to message #56977] Wed, 28 May 2008 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-4FLEfzNdJAbvHOL7MBOb
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Timothy,

No, UML Classifiers are not EClassifiers. The MDT UML2 implementation
of the UML metamodel is converted to Ecore in order to use the EMF
run-time system and to provide run-time instances that are EObjects.

Because the UML metamodel is available is available both as a UML model
(UML.metamodel.uml) and as an Ecore model (UML.ecore), you can use
either metamodel binding with it (the org.eclipse.ocl.ecore or
org.eclipse.ocl.uml plug-in). However, you will get the benefit of some
of the richer OCL semantics that are UML-specific only if you use the
latter.

Have a look at how the interactive console example plug-in
(org.eclipse.emf.ocl.examples.interpreter) works with UML models.
Follow the Examples Guide in the OCL Developer Guide on-line
documentation to get started with that. The example code is a little
bit complicated by the fact that it handles UML and Ecore models, at
both the M1 and M2 meta-levels. :-(

HTH,

Christian


On Wed, 2008-05-28 at 11:12 +0200, Timothy Marc wrote:

> Hi all,
>
> i have to use OCL for a (relatively) simple class model, created with uml2
> class-diagram editor. This is a both a valid ecore model and a valid uml2
> model, since uml2 is based or implemented on/with Ecore? So far, so good.
>
> Now, i want to use OCL for adding some constraints to my class diagram. This
> is not realy complicated, but evaluating this by the OCL plugin from eclipse
> is. So my question: Do I need the org.eclipse.ocl.ecore or the
> org.eclipse.ocl.uml plugin for evaluating OCL against the uml2 metamodel?
> Because, every uml2 classifier is of course a EClassifier? Is the
> ecore-plugin exclusively for user-defined ecore meta-models and their
> instances?
>
> This is a bit confusing.
>
> Thanks a lot for any hint
>
> Timothy
>
>

--=-4FLEfzNdJAbvHOL7MBOb
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Timothy,<BR>
<BR>
No, UML Classifiers are not EClassifiers.&nbsp; The MDT UML2 implementation of the UML metamodel is converted to Ecore in order to use the EMF run-time system and to provide run-time instances that are EObjects.<BR>
<BR>
Because the UML metamodel is available is available both as a UML model (UML.metamodel.uml) and as an Ecore model (UML.ecore), you can use either metamodel binding with it (the org.eclipse.ocl.ecore or org.eclipse.ocl.uml plug-in).&nbsp; However, you will get the benefit of some of the richer OCL semantics that are UML-specific only if you use the latter.<BR>
<BR>
Have a look at how the interactive console example plug-in (org.eclipse.emf.ocl.examples.interpreter) works with UML models.&nbsp; Follow the Examples Guide in the OCL Developer Guide on-line documentation to get started with that.&nbsp; The example code is a little bit complicated by the fact that it handles UML and Ecore models, at both the M1 and M2 meta-levels.&nbsp; :-(<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Wed, 2008-05-28 at 11:12 +0200, Timothy Marc wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi all,</FONT>

<FONT COLOR="#000000">i have to use OCL for a (relatively) simple class model, created with uml2 </FONT>
<FONT COLOR="#000000">class-diagram editor. This is a both a valid ecore model and a valid uml2 </FONT>
<FONT COLOR="#000000">model, since uml2 is based or implemented on/with Ecore? So far, so good.</FONT>

<FONT COLOR="#000000">Now, i want to use OCL for adding some constraints to my class diagram. This </FONT>
<FONT COLOR="#000000">is not realy complicated, but evaluating this by the OCL plugin from eclipse </FONT>
<FONT COLOR="#000000">is. So my question: Do I need the org.eclipse.ocl.ecore or the </FONT>
<FONT COLOR="#000000">org.eclipse.ocl.uml plugin for evaluating OCL against the uml2 metamodel? </FONT>
<FONT COLOR="#000000">Because, every uml2 classifier is of course a EClassifier? Is the </FONT>
<FONT COLOR="#000000">ecore-plugin exclusively for user-defined ecore meta-models and their </FONT>
<FONT COLOR="#000000">instances?</FONT>

<FONT COLOR="#000000">This is a bit confusing.</FONT>

<FONT COLOR="#000000">Thanks a lot for any hint</FONT>

<FONT COLOR="#000000">Timothy</FONT>


</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-4FLEfzNdJAbvHOL7MBOb--
Re: OCL for UML2 [message #57163 is a reply to message #57085] Thu, 29 May 2008 08:50 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C8C179.D73CAAA0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hey Christian,

thanks for reply. I think I missunderstood the meaning of the ocl.ecore =
and ocl.uml-plugins.

I was wondering, that you said, that there is the UML metamodel both as =
..uml and .ecore instance. IMHO, the MDT UML2 provides the following:=20
The UML2 API realizes the UML Superstructure metamodel with Ecore. So, =
it is an instance (M2) of the Ecore model. The OCL UML-plugin will =
operate on this kind of metamodel. Ecore is the meta-metamodel language =
for several metamodels, e.g. UML metamodel. The OCL ecore plugin will =
operate on these metametamodels?

Correct me if i'm wrong: If i want to add some semantics with OCL any =
Ecore model (any metametamodel), if have to use the Ecore plugin. If I =
want to add constraints explicitly to an UML model (an instance of UML =
Superstructure, which is, as said, an instance of an Ecore), i have to =
select the UML plugin, because for a constraint for an UML model doesn't =
crae about things like EClassifier, but about Classifier as specified =
both in UML Superstructure and in UML2-API.

Is this correct? Hope, i was able to present the meaning of my thoughts.

Timothy

"Christian W. Damus" <cdamus@zeligsoft.com> schrieb im Newsbeitrag =
news:1211982028.6334.19.camel@cwdlappy...
Hi, Timothy,

No, UML Classifiers are not EClassifiers. The MDT UML2 implementation =
of the UML metamodel is converted to Ecore in order to use the EMF =
run-time system and to provide run-time instances that are EObjects.

Because the UML metamodel is available is available both as a UML =
model (UML.metamodel.uml) and as an Ecore model (UML.ecore), you can use =
either metamodel binding with it (the org.eclipse.ocl.ecore or =
org.eclipse.ocl.uml plug-in). However, you will get the benefit of some =
of the richer OCL semantics that are UML-specific only if you use the =
latter.

Have a look at how the interactive console example plug-in =
(org.eclipse.emf.ocl.examples.interpreter) works with UML models. =
Follow the Examples Guide in the OCL Developer Guide on-line =
documentation to get started with that. The example code is a little =
bit complicated by the fact that it handles UML and Ecore models, at =
both the M1 and M2 meta-levels. :-(

HTH,

Christian


On Wed, 2008-05-28 at 11:12 +0200, Timothy Marc wrote:=20
Hi all,

i have to use OCL for a (relatively) simple class model, created with =
uml2=20
class-diagram editor. This is a both a valid ecore model and a valid =
uml2=20
model, since uml2 is based or implemented on/with Ecore? So far, so =
good.

Now, i want to use OCL for adding some constraints to my class diagram. =
This=20
is not realy complicated, but evaluating this by the OCL plugin from =
eclipse=20
is. So my question: Do I need the org.eclipse.ocl.ecore or the=20
org.eclipse.ocl.uml plugin for evaluating OCL against the uml2 =
metamodel?=20
Because, every uml2 classifier is of course a EClassifier? Is the=20
ecore-plugin exclusively for user-defined ecore meta-models and their=20
instances?

This is a bit confusing.

Thanks a lot for any hint

Timothy



------=_NextPart_000_000A_01C8C179.D73CAAA0
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; CHARSET=3DUTF-8">
<META content=3D"MSHTML 6.00.6000.16640" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hey Christian,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks for reply. I think I =
missunderstood the=20
meaning of the ocl.ecore and ocl.uml-plugins.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I was wondering, that you said, that =
there is the=20
UML metamodel both as .uml and .ecore instance.&nbsp;IMHO, the MDT UML2 =
provides=20
the following:&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The UML2&nbsp;API realizes the UML =
Superstructure=20
metamodel with Ecore. So, it is an instance (M2) of the Ecore model. The =
OCL=20
UML-plugin will operate on this kind of metamodel. </FONT><FONT =
face=3DArial=20
size=3D2>Ecore is the meta-metamodel language for several metamodels, =
e.g. UML=20
metamodel. The OCL ecore plugin will operate on these=20
metametamodels?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Correct me if i'm wrong: If i want to =
add some=20
semantics with OCL any Ecore model (any metametamodel), if have to use =
the Ecore=20
plugin. If&nbsp;I want to add constraints explicitly to an UML model (an =

instance of UML Superstructure, which is, as said, an instance of an =
Ecore), i=20
have to select the UML plugin, because for a constraint for an UML model =
doesn't=20
crae about things like EClassifier, but about Classifier as specified =
both in=20
UML Superstructure and in UML2-API.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is this correct? Hope, i was able to =
present the=20
meaning of my thoughts.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Timothy</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Christian W. Damus" &lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:1211982028.6334.19.camel@cwdlappy">news:1211982028.6334.19.c=
amel@cwdlappy</A>...</DIV>Hi,=20
Timothy,<BR><BR>No, UML Classifiers are not EClassifiers.&nbsp; The =
MDT UML2=20
implementation of the UML metamodel is converted to Ecore in order to =
use the=20
EMF run-time system and to provide run-time instances that are=20
EObjects.<BR><BR>Because the UML metamodel is available is available =
both as a=20
UML model (UML.metamodel.uml) and as an Ecore model (UML.ecore), you =
can use=20
either metamodel binding with it (the org.eclipse.ocl.ecore or=20
org.eclipse.ocl.uml plug-in).&nbsp; However, you will get the benefit =
of some=20
of the richer OCL semantics that are UML-specific only if you use the=20
latter.<BR><BR>Have a look at how the interactive console example =
plug-in=20
(org.eclipse.emf.ocl.examples.interpreter) works with UML =
models.&nbsp; Follow=20
the Examples Guide in the OCL Developer Guide on-line documentation to =
get=20
started with that.&nbsp; The example code is a little bit complicated =
by the=20
fact that it handles UML and Ecore models, at both the M1 and M2=20
meta-levels.&nbsp; :-(<BR><BR>HTH,<BR><BR>Christian<BR><BR><BR>On Wed, =

2008-05-28 at 11:12 +0200, Timothy Marc wrote:=20
<BLOCKQUOTE TYPE=3D"CITE"><PRE><FONT color=3D#000000>Hi all,</FONT>

<FONT color=3D#000000>i have to use OCL for a (relatively) simple class =
model, created with uml2 </FONT>
<FONT color=3D#000000>class-diagram editor. This is a both a valid ecore =
model and a valid uml2 </FONT>
<FONT color=3D#000000>model, since uml2 is based or implemented on/with =
Ecore? So far, so good.</FONT>

<FONT color=3D#000000>Now, i want to use OCL for adding some constraints =
to my class diagram. This </FONT>
<FONT color=3D#000000>is not realy complicated, but evaluating this by =
the OCL plugin from eclipse </FONT>
<FONT color=3D#000000>is. So my question: Do I need the =
org.eclipse.ocl.ecore or the </FONT>
<FONT color=3D#000000>org.eclipse.ocl.uml plugin for evaluating OCL =
against the uml2 metamodel? </FONT>
<FONT color=3D#000000>Because, every uml2 classifier is of course a =
EClassifier? Is the </FONT>
<FONT color=3D#000000>ecore-plugin exclusively for user-defined ecore =
meta-models and their </FONT>
<FONT color=3D#000000>instances?</FONT>

<FONT color=3D#000000>This is a bit confusing.</FONT>

<FONT color=3D#000000>Thanks a lot for any hint</FONT>

<FONT color=3D#000000>Timothy</FONT>


</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000A_01C8C179.D73CAAA0--
Re: OCL for UML2 [message #57295 is a reply to message #57163] Fri, 30 May 2008 03:14 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-yY8sfs7z/MBcyRSxSE7g
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Timothy,

Yes, the UML2 component realizes the merged UML Superstructure as an
Ecore model, but only as a code-generation side-effect. The source of
the UML2's genmodel is, in fact, a UML meta-model (UML.merged.uml).
This merged model is "cleaned up" and provided by the
org.eclipse.uml2.uml.resources plug-in as the UML.metamodel.uml, which
is the reference metamodel that the MDT OCL component's UML binding
uses. The UML binding does not use the UML.ecore, because it doesn't
have certain UML-specific capabilities that enhance the OCL experience
such as:

- identifying which operations are "query" operations and, therefore,
accessible to OCL
- associations, which are particularly valuable for navigating
non-navigable ends

The Ecore binding provided by MDT OCL will work with the UML.ecore, but
will have more limited functionality as compared with the UML binding
working with the UML.metamodel.uml.

You are correct: if you want to define constraints (at M1 level) in a
UML model, then you will need MDT OCL's UML binding, because it
understands UML Classifiers. If you are defining metamodel constraints
(M2 level) for UML, then you can use either the UML binding or the Ecore
binding, because MDT UML2 provides both representations of the UML
metamodel. However, you will get richer semantics from the UML binding.

HTH,

Christian

On Thu, 2008-05-29 at 10:50 +0200, Timothy Marc wrote:

> =EF=BB=BF=20
>=20
> Hey Christian,
> =20
> thanks for reply. I think I missunderstood the meaning of the
> ocl.ecore and ocl.uml-plugins.
> =20
> I was wondering, that you said, that there is the UML metamodel both
> as .uml and .ecore instance. IMHO, the MDT UML2 provides the
> following:=20
> The UML2 API realizes the UML Superstructure metamodel with Ecore. So,
> it is an instance (M2) of the Ecore model. The OCL UML-plugin will
> operate on this kind of metamodel. Ecore is the meta-metamodel
> language for several metamodels, e.g. UML metamodel. The OCL ecore
> plugin will operate on these metametamodels?
> =20
> Correct me if i'm wrong: If i want to add some semantics with OCL any
> Ecore model (any metametamodel), if have to use the Ecore plugin. If I
> want to add constraints explicitly to an UML model (an instance of UML
> Superstructure, which is, as said, an instance of an Ecore), i have to
> select the UML plugin, because for a constraint for an UML model
> doesn't crae about things like EClassifier, but about Classifier as
> specified both in UML Superstructure and in UML2-API.
> =20
> Is this correct? Hope, i was able to present the meaning of my
> thoughts.
> =20
> Timothy
> =20
> "Christian W. Damus" <cdamus@zeligsoft.com> schrieb im
> Newsbeitrag news:1211982028.6334.19.camel@cwdlappy...
> =20
> Hi, Timothy,
> =20
> No, UML Classifiers are not EClassifiers. The MDT UML2
> implementation of the UML metamodel is converted to Ecore in
> order to use the EMF run-time system and to provide run-time
> instances that are EObjects.
> =20
> Because the UML metamodel is available is available both as a
> UML model (UML.metamodel.uml) and as an Ecore model
> (UML.ecore), you can use either metamodel binding with it (the
> org.eclipse.ocl.ecore or org.eclipse.ocl.uml plug-in).
> However, you will get the benefit of some of the richer OCL
> semantics that are UML-specific only if you use the latter.
> =20
> Have a look at how the interactive console example plug-in
> (org.eclipse.emf.ocl.examples.interpreter) works with UML
> models. Follow the Examples Guide in the OCL Developer Guide
> on-line documentation to get started with that. The example
> code is a little bit complicated by the fact that it handles
> UML and Ecore models, at both the M1 and M2 meta-levels. :-(
> =20
> HTH,
> =20
> Christian
> =20
> =20
> On Wed, 2008-05-28 at 11:12 +0200, Timothy Marc wrote:=20
> =20
> > Hi all,
> >=20
> > i have to use OCL for a (relatively) simple class model, create=
d with uml2=20
> > class-diagram editor. This is a both a valid ecore model and a =
valid uml2=20
> > model, since uml2 is based or implemented on/with Ecore? So far=
, so good.
> >=20
> > Now, i want to use OCL for adding some constraints to my class =
diagram. This=20
> > is not realy complicated, but evaluating this by the OCL plugin=
from eclipse=20
> > is. So my question: Do I need the org.eclipse.ocl.ecore or the=20
> > org.eclipse.ocl.uml plugin for evaluating OCL against the uml2 =
metamodel?=20
> > Because, every uml2 classifier is of course a EClassifier? Is t=
he=20
> > ecore-plugin exclusively for user-defined ecore meta-models and=
their=20
> > instances?
> >=20
> > This is a bit confusing.
> >=20
> > Thanks a lot for any hint
> >=20
> > Timothy
> >=20
> >=20

--=-yY8sfs7z/MBcyRSxSE7g
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY BGCOLOR="#ffffff">
Hi, Timothy,<BR>
<BR>
Yes, the UML2 component realizes the merged UML Superstructure as an Ecore model, but only as a code-generation side-effect.&nbsp; The source of the UML2's genmodel is, in fact, a UML meta-model (UML.merged.uml).&nbsp; This merged model is &quot;cleaned up&quot; and provided by the org.eclipse.uml2.uml.resources plug-in as the UML.metamodel.uml, which is the reference metamodel that the MDT OCL component's UML binding uses.&nbsp; The UML binding does not use the UML.ecore, because it doesn't have certain UML-specific capabilities that enhance the OCL experience such as:<BR>
<BR>
&nbsp; - identifying which operations are &quot;query&quot; operations and, therefore, accessible to OCL<BR>
&nbsp; - associations, which are particularly valuable for navigating non-navigable ends<BR>
<BR>
The Ecore binding provided by MDT OCL will work with the UML.ecore, but will have more limited functionality as compared with the UML binding working with the UML.metamodel.uml.<BR>
<BR>
You are correct:&nbsp; if you want to define constraints (at M1 level) in a UML model, then you will need MDT OCL's UML binding, because it understands UML Classifiers.&nbsp; If you are defining metamodel constraints (M2 level) for UML, then you can use either the UML binding or the Ecore binding, because MDT UML2 provides both representations of the UML metamodel.&nbsp; However, you will get richer semantics from the UML binding.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
On Thu, 2008-05-29 at 10:50 +0200, Timothy Marc wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&#65279; </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Hey Christian,</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">thanks for reply. I think I missunderstood the meaning of the ocl.ecore and ocl.uml-plugins.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">I was wondering, that you said, that there is the UML metamodel both as .uml and .ecore instance.&nbsp;IMHO, the MDT UML2 provides the following:&nbsp;</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">The UML2&nbsp;API realizes the UML Superstructure metamodel with Ecore. So, it is an instance (M2) of the Ecore model. The OCL UML-plugin will operate on this kind of metamodel. Ecore is the meta-metamodel language for several metamodels, e.g. UML metamodel. The OCL ecore plugin will operate on these metametamodels?</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Correct me if i'm wrong: If i want to add some semantics with OCL any Ecore model (any metametamodel), if have to use the Ecore plugin. If&nbsp;I want to add constraints explicitly to an UML model (an instance of UML Superstructure, which is, as said, an instance of an Ecore), i have to select the UML plugin, because for a constraint for an UML model doesn't crae about things like EClassifier, but about Classifier as specified both in UML Superstructure and in UML2-API.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Is this correct? Hope, i was able to present the meaning of my thoughts.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">Timothy</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">&quot;Christian W. Damus&quot; &lt;<A HREF="mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; schrieb im Newsbeitrag <A HREF="news:1211982028.6334.19.camel@cwdlappy">news:1211982028.6334.19.camel@cwdlappy</A>...</FONT>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">Hi, Timothy,</FONT><BR>
<BR>
<FONT COLOR="#000000">No, UML Classifiers are not EClassifiers.&nbsp; The MDT UML2 implementation of the UML metamodel is converted to Ecore in order to use the EMF run-time system and to provide run-time instances that are EObjects.</FONT><BR>
<BR>
<FONT COLOR="#000000">Because the UML metamodel is available is available both as a UML model (UML.metamodel.uml) and as an Ecore model (UML.ecore), you can use either metamodel binding with it (the org.eclipse.ocl.ecore or org.eclipse.ocl.uml plug-in).&nbsp; However, you will get the benefit of some of the richer OCL semantics that are UML-specific only if you use the latter.</FONT><BR>
<BR>
<FONT COLOR="#000000">Have a look at how the interactive console example plug-in (org.eclipse.emf.ocl.examples.interpreter) works with UML models.&nbsp; Follow the Examples Guide in the OCL Developer Guide on-line documentation to get started with that.&nbsp; The example code is a little bit complicated by the fact that it handles UML and Ecore models, at both the M1 and M2 meta-levels.&nbsp; :-(</FONT><BR>
<BR>
<FONT COLOR="#000000">HTH,</FONT><BR>
<BR>
<FONT COLOR="#000000">Christian</FONT><BR>
<BR>
<BR>
<FONT COLOR="#000000">On Wed, 2008-05-28 at 11:12 +0200, Timothy Marc wrote: </FONT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi all,</FONT>

<FONT COLOR="#000000">i have to use OCL for a (relatively) simple class model, created with uml2 </FONT>
<FONT COLOR="#000000">class-diagram editor. This is a both a valid ecore model and a valid uml2 </FONT>
<FONT COLOR="#000000">model, since uml2 is based or implemented on/with Ecore? So far, so good.</FONT>

<FONT COLOR="#000000">Now, i want to use OCL for adding some constraints to my class diagram. This </FONT>
<FONT COLOR="#000000">is not realy complicated, but evaluating this by the OCL plugin from eclipse </FONT>
<FONT COLOR="#000000">is. So my question: Do I need the org.eclipse.ocl.ecore or the </FONT>
<FONT COLOR="#000000">org.eclipse.ocl.uml plugin for evaluating OCL against the uml2 metamodel? </FONT>
<FONT COLOR="#000000">Because, every uml2 classifier is of course a EClassifier? Is the </FONT>
<FONT COLOR="#000000">ecore-plugin exclusively for user-defined ecore meta-models and their </FONT>
<FONT COLOR="#000000">instances?</FONT>

<FONT COLOR="#000000">This is a bit confusing.</FONT>

<FONT COLOR="#000000">Thanks a lot for any hint</FONT>

<FONT COLOR="#000000">Timothy</FONT>


</PRE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-yY8sfs7z/MBcyRSxSE7g--
Previous Topic:OCL context for an attribute?
Next Topic:querying across multiple XMI resources
Goto Forum:
  


Current Time: Thu Apr 25 14:45:34 GMT 2024

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

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

Back to the top