Skip to main content



      Home
Home » Modeling » OCL » retrieving stereotypes
retrieving stereotypes [message #39599] Mon, 01 October 2007 03:31 Go to next message
Eclipse UserFriend
Originally posted by: firstname.name.gmail.com

Hello,

I would like to know how to retrieve applied stereotype to a model element in a
OCL way. I know that a element my navigate to a stereotype with the
extension_MyStereotype role, but how to do that if we want to query all
stereotypes. A solution may be to look at all properties starting by
"extension_" but this is a non-navigable association...

thanks.

--
F. Lagarde
Re: retrieving stereotypes [message #39693 is a reply to message #39599] Mon, 01 October 2007 09:43 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, François,

Generically finding all extensions would require reflection capabilities
that OCL does not offer. To do what you need, you would have to create a
custom Environment implementation that adds some additional operation
implemented in Java using the UML2 API. Of course, you will have to
declare a result type for such an operation, which implies that your
stereotypes all have some common ancestor other than OclAny in order for
this to be useful.

Cheers,

Christian


François Lagarde wrote:

> Hello,
>
> I would like to know how to retrieve applied stereotype to a model element
> in a
> OCL way. I know that a element my navigate to a stereotype with the
> extension_MyStereotype role, but how to do that if we want to query all
> stereotypes. A solution may be to look at all properties starting by
> "extension_" but this is a non-navigable association...
>
> thanks.
>
Previous Topic:[OCL Tools] article draft
Next Topic:Package name conflict caused OCL parsing to fail
Goto Forum:
  


Current Time: Thu May 29 08:57:27 EDT 2025

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

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

Back to the top