Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » getStereotypeApplication()
getStereotypeApplication() [message #57962] Mon, 09 June 2008 07:28 Go to next message
Eclipse User
Originally posted by: asma.charfi.com

Hi,
I have problem with getStereotypeApplication()
my context =self is a port
self.getStereotypeApplications() returns a set of sereotpes() applied to the
port

but self.getStereotypeApplication('Qualified Name') generate this error:

ERROR in (operationCallExpCS): (Cannot find operation
(getStereotypeApplication(String)) for the type (Port))

How can getStereotypeApplications() succed and
getStereotypeApplication(Steing) did not?

Thank you

Asma
Re: getStereotypeApplication() [message #57986 is a reply to message #57962] Sun, 08 June 2008 22:37 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

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

Hi, Asma,

The getStereotypeApplications() operation returns instances of all of
the stereotypes currently applied to an element. Just to be clear,
these are stereotype *instances* (EObjects), not Stereotypes (which are
UML Classes).

The required input to the getStereotypeApplication(Stereotype) operation
is not a string, but a Stereotype. Currently, the only way to get this
stereotype in an OCL expression is using the
getApplicableStereotype(String) operation or some other such. Try this:


self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Name'))

where Qualified::Name is the qualified name of your stereotype.

HTH,

Christian

On Mon, 2008-06-09 at 00:28 -0700, charfi asma wrote:

> Hi,
> I have problem with getStereotypeApplication()
> my context =self is a port
> self.getStereotypeApplications() returns a set of sereotpes() applied to the
> port
>
> but self.getStereotypeApplication('Qualified Name') generate this error:
>
> ERROR in (operationCallExpCS): (Cannot find operation
> (getStereotypeApplication(String)) for the type (Port))
>
> How can getStereotypeApplications() succed and
> getStereotypeApplication(Steing) did not?
>
> Thank you
>
> Asma
>
>

--=-ITMHA7LZTlXaounA3Q7B
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, Asma,<BR>
<BR>
The getStereotypeApplications() operation returns instances of all of the stereotypes currently applied to an element.&nbsp; Just to be clear, these are stereotype *instances* (EObjects), not Stereotypes (which are UML Classes).<BR>
<BR>
The required input to the getStereotypeApplication(Stereotype) operation is not a string, but a Stereotype.&nbsp; Currently, the only way to get this stereotype in an OCL expression is using the getApplicableStereotype(String) operation or some other such.&nbsp; Try this:<BR>
<BR>
&nbsp; self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Name')) <BR>
<BR>
where Qualified::Name is the qualified name of your stereotype.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
On Mon, 2008-06-09 at 00:28 -0700, charfi asma wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi,</FONT>
<FONT COLOR="#000000">I have problem with getStereotypeApplication()</FONT>
<FONT COLOR="#000000">my context =self is a port</FONT>
<FONT COLOR="#000000">self.getStereotypeApplications() returns a set of sereotpes() applied to the </FONT>
<FONT COLOR="#000000">port</FONT>

<FONT COLOR="#000000">but self.getStereotypeApplication('Qualified Name') generate this error:</FONT>

<FONT COLOR="#000000">ERROR in (operationCallExpCS): (Cannot find operation </FONT>
<FONT COLOR="#000000">(getStereotypeApplication(String)) for the type (Port))</FONT>

<FONT COLOR="#000000">How can getStereotypeApplications() succed and </FONT>
<FONT COLOR="#000000">getStereotypeApplication(Steing) did not?</FONT>

<FONT COLOR="#000000">Thank you</FONT>

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


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

--=-ITMHA7LZTlXaounA3Q7B--
Re: getStereotypeApplication() [message #58010 is a reply to message #57986] Mon, 09 June 2008 19:30 Go to previous messageGo to next message
Eclipse User
Originally posted by: asma.charfi.com

This is a multi-part message in MIME format.

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

hi,
I use MARTE profile, and the stereotype applied to the port is called =
FlowPort and exists in a GCM package.
I tried =
self.getStereotypeApplication(self.getApplicableStereotype(' GCM::FlowPort=
')) but it did not give result (blank)
when I evaluate self.getStereotypeApplications() the result is: Flow =
Port false
when I evaluate self.getStereotypeApplication(GCM::FlowPort) the =
result is: ERROR in (operationCallExpCS): (Cannot find operation =
(getStereotypeApplication(OclType)) for the type (Port))
when I evaluate =
self.getStereotypeApplication(GCM::FlowPort.oclAsType(Stereo type)) the =
result is: Invalid Class

what is the difference between invalidclass, blank or error gererated in =
the ocl Interpretor

thank you very much

Asma

"Christian W. Damus" <cdamus@zeligsoft.com> a =C3=A9crit dans le message =
de news: 1212964670.7175.13.camel@cwdlappy...
Hi, Asma,

The getStereotypeApplications() operation returns instances of all of =
the stereotypes currently applied to an element. Just to be clear, =
these are stereotype *instances* (EObjects), not Stereotypes (which are =
UML Classes).

The required input to the getStereotypeApplication(Stereotype) =
operation is not a string, but a Stereotype. Currently, the only way to =
get this stereotype in an OCL expression is using the =
getApplicableStereotype(String) operation or some other such. Try this:

=
self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Na=
me'))

where Qualified::Name is the qualified name of your stereotype.

HTH,

Christian

On Mon, 2008-06-09 at 00:28 -0700, charfi asma wrote:=20
Hi,
I have problem with getStereotypeApplication()
my context =3Dself is a port
self.getStereotypeApplications() returns a set of sereotpes() applied to =
the=20
port

but self.getStereotypeApplication('Qualified Name') generate this =
error:

ERROR in (operationCallExpCS): (Cannot find operation=20
(getStereotypeApplication(String)) for the type (Port))

How can getStereotypeApplications() succed and=20
getStereotypeApplication(Steing) did not?

Thank you

Asma



------=_NextPart_000_000D_01C8CA2C.97362920
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.20772" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I use MARTE profile, and the stereotype =
applied to=20
the port is called FlowPort and exists in a GCM package.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I tried&nbsp; <FONT=20
size=3D2> self.getStereotypeApplication(self.getApplicableStereotype(' GCM:=
:FlowPort'))=20
but it did not give result (blank)</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>when I evaluate <FONT=20
face=3D"Times New Roman">self.getStereotypeApplications() the result is: =

&nbsp;Flow Port false</FONT></FONT></DIV>
<DIV><FONT size=3D2>when I evaluate&nbsp;&nbsp; <FONT=20
size=3D2>self.getStereotypeApplication(GCM::FlowPort) the result is: =
<FONT=20
color=3D#c00000>&nbsp; <FONT size=3D2>ERROR in (operationCallExpCS): =
(Cannot find=20
operation (getStereotypeApplication(OclType)) for the type=20
(Port))</FONT></FONT></FONT></FONT></DIV>
<DIV><FONT color=3D#c00000 size=3D2>when I evaluate&nbsp; <FONT=20
size=3D2> self.getStereotypeApplication(GCM::FlowPort.oclAsType(Stereo type=
)) the=20
result is:&nbsp; <FONT color=3D#0000c0 size=3D2>Invalid=20
Class</FONT></FONT></FONT></DIV>
<DIV><FONT color=3D#0000c0 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000c0 size=3D2>what is the difference between =
invalidclass,=20
blank or error gererated in the ocl Interpretor</FONT></DIV>
<DIV><FONT color=3D#0000c0 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000c0 size=3D2>thank you very much</FONT></DIV>
<DIV><FONT color=3D#0000c0 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000c0 size=3D2>Asma</FONT></DIV>
<DIV><FONT color=3D#0000c0 size=3D2></FONT>&nbsp;</DIV>
<DIV>"Christian W. Damus" &lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; a =
=C3=A9crit dans le=20
message de news: <A=20
href=3D"mailto:1212964670.7175.13.camel@cwdlappy">1212964670.7175.13.came=
l@cwdlappy</A>...</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Hi,=20
Asma,<BR><BR>The getStereotypeApplications() operation returns =
instances of=20
all of the stereotypes currently applied to an element.&nbsp; Just to =
be=20
clear, these are stereotype *instances* (EObjects), not Stereotypes =
(which are=20
UML Classes).<BR><BR>The required input to the=20
getStereotypeApplication(Stereotype) operation is not a string, but a=20
Stereotype.&nbsp; Currently, the only way to get this stereotype in an =
OCL=20
expression is using the getApplicableStereotype(String) operation or =
some=20
other such.&nbsp; Try this:<BR><BR>&nbsp;=20
=
self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Na=
me'))<BR><BR>where=20
Qualified::Name is the qualified name of your=20
stereotype.<BR><BR>HTH,<BR><BR>Christian<BR><BR>On Mon, 2008-06-09 at =
00:28=20
-0700, charfi asma wrote:=20
<BLOCKQUOTE TYPE=3D"CITE"><PRE><FONT color=3D#000000>Hi,</FONT>
<FONT color=3D#000000>I have problem with =
getStereotypeApplication()</FONT>
<FONT color=3D#000000>my context =3Dself is a port</FONT>
<FONT color=3D#000000>self.getStereotypeApplications() returns a set of =
sereotpes() applied to the </FONT>
<FONT color=3D#000000>port</FONT>

<FONT color=3D#000000>but self.getStereotypeApplication('Qualified =
Name') generate this error:</FONT>

<FONT color=3D#000000>ERROR in (operationCallExpCS): (Cannot find =
operation </FONT>
<FONT color=3D#000000>(getStereotypeApplication(String)) for the type =
(Port))</FONT>

<FONT color=3D#000000>How can getStereotypeApplications() succed and =
</FONT>
<FONT color=3D#000000>getStereotypeApplication(Steing) did not?</FONT>

<FONT color=3D#000000>Thank you</FONT>

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


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

------=_NextPart_000_000D_01C8CA2C.97362920--
Re: getStereotypeApplication() [message #58063 is a reply to message #58010] Mon, 09 June 2008 22:58 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

--=-KhxhEp+6seh9iOQmmtFs
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Asma,

See some replies in-line, below.

HTH,

Christian


On Mon, 2008-06-09 at 12:30 -0700, charfi asma wrote:

> =EF=BB=BF=20
>=20
> hi,
> I use MARTE profile, and the stereotype applied to the port is called
> FlowPort and exists in a GCM package.
> I tried
> self.getStereotypeApplication(self.getApplicableStereotype(' GCM::FlowPort=
')) but it did not give result (blank)

Try enabling the "evaluation" tracing option for org.eclipse.ocl in your
run-time workbench launch configuration. This will print, on the
console, the result of the evaluation of each and every sub-expression.
What do you see for the evaluation of the
getApplicableStereotype(String) and getStereotypeApplication(Stereotype)
calls?


> when I evaluate self.getStereotypeApplications() the result is: Flow
> Port false
> when I evaluate self.getStereotypeApplication(GCM::FlowPort) the
> result is: ERROR in (operationCallExpCS): (Cannot find operation
> (getStereotypeApplication(OclType)) for the type (Port))


Right. The parser uses an (IMO) obsolete OclType classifier in
expressions that reference types such as GCM::FlowPort, instead of the
Classifier metaclass. OclType is not compatible with Stereotype. This
is a manifestation of this bug:

https://bugs.eclipse.org/190150

> when I evaluate
> self.getStereotypeApplication(GCM::FlowPort.oclAsType(Stereo type)) the
> result is: Invalid Class


This is the OCL manifestation of a run-time exception (the OclInvalid
literal). Probably, Java is throwing a ClassCastException on the
attempt to cast an OclType to Stereotype.

> =20
> what is the difference between invalidclass, blank or error gererated
> in the ocl Interpretor


Blank usually just is an empty collection value. The error message is a
syntax error (parse-time failure) and the OclInvalid is an evalution
error (run-time problem).

> =20
> thank you very much
> =20
> Asma
> =20
> "Christian W. Damus" <cdamus@zeligsoft.com> a =C3=A9crit dans le message =
de
> news: 1212964670.7175.13.camel@cwdlappy...
> =20
> Hi, Asma,
> =20
> The getStereotypeApplications() operation returns instances of
> all of the stereotypes currently applied to an element. Just
> to be clear, these are stereotype *instances* (EObjects), not
> Stereotypes (which are UML Classes).
> =20
> The required input to the getStereotypeApplication(Stereotype)
> operation is not a string, but a Stereotype. Currently, the
> only way to get this stereotype in an OCL expression is using
> the getApplicableStereotype(String) operation or some other
> such. Try this:
> =20
> =20
> self.getStereotypeApplication(self.getApplicableStereotype(' Quali=
fied::Name'))
> =20
> where Qualified::Name is the qualified name of your
> stereotype.
> =20
> HTH,
> =20
> Christian
> =20
> On Mon, 2008-06-09 at 00:28 -0700, charfi asma wrote:=20
> =20
> > Hi,
> > I have problem with getStereotypeApplication()
> > my context =3Dself is a port
> > self.getStereotypeApplications() returns a set of sereotpes() a=
pplied to the=20
> > port
> >=20
> > but self.getStereotypeApplication('Qualified Name') generate t=
his error:
> >=20
> > ERROR in (operationCallExpCS): (Cannot find operation=20
> > (getStereotypeApplication(String)) for the type (Port))
> >=20
> > How can getStereotypeApplications() succed and=20
> > getStereotypeApplication(Steing) did not?
> >=20
> > Thank you
> >=20
> > Asma
> >=20
> >=20

--=-KhxhEp+6seh9iOQmmtFs
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, Asma,<BR>
<BR>
See some replies in-line, below.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Mon, 2008-06-09 at 12:30 -0700, charfi asma wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&#65279; </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">hi,</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">I use MARTE profile, and the stereotype applied to the port is called FlowPort and exists in a GCM package.</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">I tried&nbsp; self.getStereotypeApplication(self.getApplicableStereotype(' GCM::FlowPort')) but it did not give result (blank)</FONT></FONT><BR>
</BLOCKQUOTE>
Try enabling the &quot;evaluation&quot; tracing option for org.eclipse.ocl in your run-time workbench launch configuration.&nbsp; This will print, on the console, the result of the evaluation of each and every sub-expression.&nbsp; What do you see for the evaluation of the getApplicableStereotype(String) and getStereotypeApplication(Stereotype) calls?<BR>
<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">when I evaluate self.getStereotypeApplications() the result is:&nbsp; Flow Port false</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#000000">when I evaluate&nbsp;&nbsp; self.getStereotypeApplication(GCM::FlowPort) the result is:&nbsp;</FONT></FONT><FONT SIZE="2"><FONT COLOR="#c00000">&nbsp; ERROR in (operationCallExpCS): (Cannot find operation (getStereotypeApplication(OclType)) for the type (Port)</FONT></FONT>)<BR>
</BLOCKQUOTE>
<BR>
Right.&nbsp; The parser uses an (IMO) obsolete OclType classifier in expressions that reference types such as GCM::FlowPort, instead of the Classifier metaclass.&nbsp; OclType is not compatible with Stereotype.&nbsp; This is a manifestation of this bug:<BR>
<BR>
<A HREF="https://bugs.eclipse.org/bugs/show_bug.cgi?id=190150">https://bugs.eclipse.org/190150</A><BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#c00000">when I evaluate&nbsp; self.getStereotypeApplication(GCM::FlowPort.oclAsType(Stereo type)) the result is:&nbsp; </FONT></FONT><FONT SIZE="2"><FONT COLOR="#0000c0">Invalid Class</FONT></FONT><BR>
</BLOCKQUOTE>
<BR>
This is the OCL manifestation of a run-time exception (the OclInvalid literal).&nbsp; Probably, Java is throwing a ClassCastException on the attempt to cast an OclType to Stereotype.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#0000c0">what is the difference between invalidclass, blank or error gererated in the ocl Interpretor</FONT></FONT><BR>
</BLOCKQUOTE>
<BR>
Blank usually just is an empty collection value.&nbsp; The error message is a syntax error (parse-time failure) and the OclInvalid is an evalution error (run-time problem).<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#0000c0">thank you very much</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT SIZE="2"><FONT COLOR="#0000c0">Asma</FONT></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">&quot;Christian W. Damus&quot; &lt;<A HREF="mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; a &#233;crit dans le message de news: <A HREF="mailto:1212964670.7175.13.camel@cwdlappy">1212964670.7175.13.camel@cwdlappy</A>...</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE>
<FONT COLOR="#000000">Hi, Asma,</FONT><BR>
<BR>
<FONT COLOR="#000000">The getStereotypeApplications() operation returns instances of all of the stereotypes currently applied to an element.&nbsp; Just to be clear, these are stereotype *instances* (EObjects), not Stereotypes (which are UML Classes).</FONT><BR>
<BR>
<FONT COLOR="#000000">The required input to the getStereotypeApplication(Stereotype) operation is not a string, but a Stereotype.&nbsp; Currently, the only way to get this stereotype in an OCL expression is using the getApplicableStereotype(String) operation or some other such.&nbsp; Try this:</FONT><BR>
<BR>
<FONT COLOR="#000000">&nbsp; self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Name')) </FONT><BR>
<BR>
<FONT COLOR="#000000">where Qualified::Name is the qualified name of your stereotype.</FONT><BR>
<BR>
<FONT COLOR="#000000">HTH,</FONT><BR>
<BR>
<FONT COLOR="#000000">Christian</FONT><BR>
<BR>
<FONT COLOR="#000000">On Mon, 2008-06-09 at 00:28 -0700, charfi asma wrote: </FONT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi,</FONT>
<FONT COLOR="#000000">I have problem with getStereotypeApplication()</FONT>
<FONT COLOR="#000000">my context =self is a port</FONT>
<FONT COLOR="#000000">self.getStereotypeApplications() returns a set of sereotpes() applied to the </FONT>
<FONT COLOR="#000000">port</FONT>

<FONT COLOR="#000000">but self.getStereotypeApplication('Qualified Name') generate this error:</FONT>

<FONT COLOR="#000000">ERROR in (operationCallExpCS): (Cannot find operation </FONT>
<FONT COLOR="#000000">(getStereotypeApplication(String)) for the type (Port))</FONT>

<FONT COLOR="#000000">How can getStereotypeApplications() succed and </FONT>
<FONT COLOR="#000000">getStereotypeApplication(Steing) did not?</FONT>

<FONT COLOR="#000000">Thank you</FONT>

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


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

--=-KhxhEp+6seh9iOQmmtFs--
Re: getStereotypeApplication() [message #58138 is a reply to message #58063] Wed, 11 June 2008 02:59 Go to previous message
Eclipse User
Originally posted by: asma.charfi.com

This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C8CB34.83765F50
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

thank you christian :)
"Christian W. Damus" <cdamus@zeligsoft.com> a =C3=A9crit dans le =
message de news: 1213052296.6426.8.camel@cwdlappy...
Hi, Asma,

See some replies in-line, below.

HTH,

Christian


On Mon, 2008-06-09 at 12:30 -0700, charfi asma wrote:

=EF=BB=BF=20
hi,=20
I use MARTE profile, and the stereotype applied to the port is =
called FlowPort and exists in a GCM package.=20
I tried =
self.getStereotypeApplication(self.getApplicableStereotype(' GCM::FlowPort=
')) but it did not give result (blank)

Try enabling the "evaluation" tracing option for org.eclipse.ocl in =
your run-time workbench launch configuration. This will print, on the =
console, the result of the evaluation of each and every sub-expression. =
What do you see for the evaluation of the =
getApplicableStereotype(String) and getStereotypeApplication(Stereotype) =
calls?



when I evaluate self.getStereotypeApplications() the result is: =
Flow Port false=20
when I evaluate self.getStereotypeApplication(GCM::FlowPort) the =
result is: ERROR in (operationCallExpCS): (Cannot find operation =
(getStereotypeApplication(OclType)) for the type (Port))


Right. The parser uses an (IMO) obsolete OclType classifier in =
expressions that reference types such as GCM::FlowPort, instead of the =
Classifier metaclass. OclType is not compatible with Stereotype. This =
is a manifestation of this bug:

https://bugs.eclipse.org/190150


when I evaluate =
self.getStereotypeApplication(GCM::FlowPort.oclAsType(Stereo type)) the =
result is: Invalid Class


This is the OCL manifestation of a run-time exception (the OclInvalid =
literal). Probably, Java is throwing a ClassCastException on the =
attempt to cast an OclType to Stereotype.


=20
what is the difference between invalidclass, blank or error =
gererated in the ocl Interpretor


Blank usually just is an empty collection value. The error message is =
a syntax error (parse-time failure) and the OclInvalid is an evalution =
error (run-time problem).


=20
thank you very much=20
=20
Asma=20
=20
"Christian W. Damus" <cdamus@zeligsoft.com> a =C3=A9crit dans le =
message de news: 1212964670.7175.13.camel@cwdlappy...=20
Hi, Asma,

The getStereotypeApplications() operation returns instances of all =
of the stereotypes currently applied to an element. Just to be clear, =
these are stereotype *instances* (EObjects), not Stereotypes (which are =
UML Classes).

The required input to the getStereotypeApplication(Stereotype) =
operation is not a string, but a Stereotype. Currently, the only way to =
get this stereotype in an OCL expression is using the =
getApplicableStereotype(String) operation or some other such. Try this:

=
self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Na=
me'))

where Qualified::Name is the qualified name of your stereotype.

HTH,

Christian

On Mon, 2008-06-09 at 00:28 -0700, charfi asma wrote:=20
Hi,
I have problem with getStereotypeApplication()
my context =3Dself is a port
self.getStereotypeApplications() returns a set of sereotpes() applied to =
the=20
port

but self.getStereotypeApplication('Qualified Name') generate this =
error:

ERROR in (operationCallExpCS): (Cannot find operation=20
(getStereotypeApplication(String)) for the type (Port))

How can getStereotypeApplications() succed and=20
getStereotypeApplication(Steing) did not?

Thank you

Asma



------=_NextPart_000_000D_01C8CB34.83765F50
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.20772" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>thank you christian :)</FONT></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; a =
=C3=A9crit dans=20
le message de news: <A=20
=
href=3D"mailto:1213052296.6426.8.camel@cwdlappy">1213052296.6426.8.camel@=
cwdlappy</A>...</DIV>Hi,=20
Asma,<BR><BR>See some replies in-line,=20
below.<BR><BR>HTH,<BR><BR>Christian<BR><BR><BR>On Mon, 2008-06-09 at =
12:30=20
-0700, charfi asma wrote:<BR>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000>=EF=BB=BF =
</FONT></BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT =
color=3D#000000>hi,</FONT></FONT>=20
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#000000>I use =
MARTE=20
profile, and the stereotype applied to the port is called FlowPort =
and=20
exists in a GCM package.</FONT></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#000000>I =
tried&nbsp;=20
=
self.getStereotypeApplication(self.getApplicableStereotype(' GCM::FlowPort=
'))=20
but it did not give result (blank)</FONT></FONT><BR></BLOCKQUOTE>Try =
enabling=20
the "evaluation" tracing option for org.eclipse.ocl in your run-time =
workbench=20
launch configuration.&nbsp; This will print, on the console, the =
result of the=20
evaluation of each and every sub-expression.&nbsp; What do you see for =
the=20
evaluation of the getApplicableStereotype(String) and=20
getStereotypeApplication(Stereotype) calls?<BR><BR><BR>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#000000>when I =
evaluate=20
self.getStereotypeApplications() the result is:&nbsp; Flow Port=20
false</FONT></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#000000>when I=20
evaluate&nbsp;&nbsp; self.getStereotypeApplication(GCM::FlowPort) =
the result=20
is:&nbsp;</FONT></FONT><FONT size=3D2><FONT color=3D#c00000>&nbsp; =
ERROR in=20
(operationCallExpCS): (Cannot find operation=20
(getStereotypeApplication(OclType)) for the type=20
(Port)</FONT></FONT>)<BR></BLOCKQUOTE><BR>Right.&nbsp; The parser uses =
an=20
(IMO) obsolete OclType classifier in expressions that reference types =
such as=20
GCM::FlowPort, instead of the Classifier metaclass.&nbsp; OclType is =
not=20
compatible with Stereotype.&nbsp; This is a manifestation of this=20
bug:<BR><BR><A=20
=
href=3D"https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D190150">https://b=
ugs.eclipse.org/190150</A><BR><BR>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#c00000>when I=20
evaluate&nbsp;=20
self.getStereotypeApplication(GCM::FlowPort.oclAsType(Stereo type)) =
the=20
result is:&nbsp; </FONT></FONT><FONT size=3D2><FONT =
color=3D#0000c0>Invalid=20
Class</FONT></FONT><BR></BLOCKQUOTE><BR>This is the OCL =
manifestation of a=20
run-time exception (the OclInvalid literal).&nbsp; Probably, Java is =
throwing=20
a ClassCastException on the attempt to cast an OclType to =
Stereotype.<BR><BR>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#0000c0>what is =
the=20
difference between invalidclass, blank or error gererated in the ocl =

Interpretor</FONT></FONT><BR></BLOCKQUOTE><BR>Blank usually just is =
an empty=20
collection value.&nbsp; The error message is a syntax error =
(parse-time=20
failure) and the OclInvalid is an evalution error (run-time =
problem).<BR><BR>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT color=3D#0000c0>thank =
you very=20
much</FONT></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT size=3D2><FONT =
color=3D#0000c0>Asma</FONT></FONT>=20
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000></FONT> </BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE"><FONT color=3D#000000>"Christian W. Damus" =
&lt;<A=20
href=3D"mailto:cdamus@zeligsoft.com">cdamus@zeligsoft.com</A>&gt; a =
=C3=A9crit dans=20
le message de news: <A=20
=
href=3D"mailto:1212964670.7175.13.camel@cwdlappy">1212964670.7175.13.came=
l@cwdlappy</A>...</FONT>=20
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=3D"CITE">
<BLOCKQUOTE><FONT color=3D#000000>Hi, Asma,</FONT><BR><BR><FONT=20
color=3D#000000>The getStereotypeApplications() operation returns =
instances=20
of all of the stereotypes currently applied to an element.&nbsp; =
Just to=20
be clear, these are stereotype *instances* (EObjects), not =
Stereotypes=20
(which are UML Classes).</FONT><BR><BR><FONT color=3D#000000>The =
required=20
input to the getStereotypeApplication(Stereotype) operation is not =
a=20
string, but a Stereotype.&nbsp; Currently, the only way to get =
this=20
stereotype in an OCL expression is using the=20
getApplicableStereotype(String) operation or some other =
such.&nbsp; Try=20
this:</FONT><BR><BR><FONT color=3D#000000>&nbsp;=20
=
self.getStereotypeApplication(self.getApplicableStereotype(' Qualified::Na=
me'))</FONT><BR><BR><FONT=20
color=3D#000000>where Qualified::Name is the qualified name of =
your=20
stereotype.</FONT><BR><BR><FONT =
color=3D#000000>HTH,</FONT><BR><BR><FONT=20
color=3D#000000>Christian</FONT><BR><BR><FONT color=3D#000000>On =
Mon,=20
2008-06-09 at 00:28 -0700, charfi asma wrote: </FONT>
<BLOCKQUOTE TYPE=3D"CITE"><PRE><FONT color=3D#000000>Hi,</FONT>
<FONT color=3D#000000>I have problem with =
getStereotypeApplication()</FONT>
<FONT color=3D#000000>my context =3Dself is a port</FONT>
<FONT color=3D#000000>self.getStereotypeApplications() returns a set of =
sereotpes() applied to the </FONT>
<FONT color=3D#000000>port</FONT>

<FONT color=3D#000000>but self.getStereotypeApplication('Qualified =
Name') generate this error:</FONT>

<FONT color=3D#000000>ERROR in (operationCallExpCS): (Cannot find =
operation </FONT>
<FONT color=3D#000000>(getStereotypeApplication(String)) for the type =
(Port))</FONT>

<FONT color=3D#000000>How can getStereotypeApplications() succed and =
</FONT>
<FONT color=3D#000000>getStereotypeApplication(Steing) did not?</FONT>

<FONT color=3D#000000>Thank you</FONT>

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


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

------=_NextPart_000_000D_01C8CB34.83765F50--
Previous Topic:GMF/OCL Bug?
Next Topic:how to detect cycle in OCL
Goto Forum:
  


Current Time: Tue Sep 30 18:12:50 GMT 2014

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

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