Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL, profiles and namespaces
OCL, profiles and namespaces [message #64225] Wed, 05 November 2008 07:54 Go to next message
Alexander  is currently offline Alexander
Messages: 23
Registered: July 2009
Junior Member
Hi all,

I'm using ocl to validate some uml models. These models, and the ocl too,
use a lot of profiles. For now I have used getAppliedStereotypes etc. But
after upgrading to RSA 7.5 these rules don't work anymore.

Using the normal UML Editor nothing is wrong, but with an older RSA/RSD
version, I could use the same rules, using the same extensionpoint method,
directly on the emx files.
I know this isn't a RSA/RSD forum/newsgroup, but I think it has to do with
the getAppliedStereotypes methods, and now want to use the OCL/UML
standard extension_StereotypeName method.

In RSA I end up getting a error that there are multiple association ends
with the same name. Using emf I gen an error that the variable isn't
recognized.

Is it possible to use extension_ and if so, can I use the stereotype
namespace using the extension_ mechanism? When using getAppliedStereotype
the stereotype name would be MyProfile::StereotypeName, with
extension_StereotypeName as the other way.

TiA!
Re: OCL, profiles and namespaces [message #64297 is a reply to message #64225] Wed, 05 November 2008 13:34 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Hi, Alexander,

See some comments in-line, below.

HTH,

Christian

Alexander wrote:
> Hi all,
>
> I'm using ocl to validate some uml models. These models, and the ocl
> too, use a lot of profiles. For now I have used getAppliedStereotypes
> etc. But after upgrading to RSA 7.5 these rules don't work anymore.

Hmmm ... the getAppliedStereotypes() implementation in Eclipse UML2
hasn't changed in the last release, as far as I know. What do you mean
by "doesn't work?" You get a parsing error, or unexpected results?
Please, be more specific.


> Using the normal UML Editor nothing is wrong, but with an older RSA/RSD
> version, I could use the same rules, using the same extensionpoint
> method, directly on the emx files.
> I know this isn't a RSA/RSD forum/newsgroup, but I think it has to do
> with the getAppliedStereotypes methods, and now want to use the OCL/UML
> standard extension_StereotypeName method.

Well, as I indicated, getAppliedStereotypes() hasn't changed AFAIK.
Also, if RSA implements its OCL support on our Eclipse implementation,
they may still have customized it by the various way in which the API
provides, be it specialized Environments or whatever. It would be hard
to guess ...


> In RSA I end up getting a error that there are multiple association ends
> with the same name. Using emf I gen an error that the variable isn't
> recognized.

The Ecore representation of UML and your profile doesn't recognize an
extension_Xyz property because it's an association-owned end, not a
property of any EClass. Ecore doesn't have associations, and so doesn't
support this construct.

If you have multiple stereotypes applicable to (extending) the same UML
metaclass, that have the same name, then you will see this problem.
Given two profiles P1 and P2 that both have stereotypes S extending,
say, Actor, then a constraint in the Actor context will see two
extension ends named extension_S. You will either have to rename one
(or both) of the stereotypes, or else one (or both) of the extension
ends. I think, though, that the latter option would not be proper UML
practice (although the ExtensionEnd metaclass doesn't have a formal
constraint on its name).


> Is it possible to use extension_ and if so, can I use the stereotype
> namespace using the extension_ mechanism? When using
> getAppliedStereotype the stereotype name would be
> MyProfile::StereotypeName, with extension_StereotypeName as the other way.

If you can parse your OCL constraint in a ResourceSet that only has one
of the profiles loaded that have the duplicate stereotype names, then
you would not have this conflict. Otherwise, it might be interesting to
look at enhancing the OCL API to allow an environment to specify the
scope of packages that it will search to resolve names (currently it
searches the entire resource set).

>
> TiA!
>
Re: OCL, profiles and namespaces [message #64567 is a reply to message #64225] Mon, 10 November 2008 18:47 Go to previous message
Linda Damus is currently offline Linda Damus
Messages: 85
Registered: July 2009
Member
Alexander,

Regarding the error that you see about multiple association ends with
the same name, it seems there is no way to qualify those extension end
names. This is an open issue with the OCL 2.0 specification:

http://www.omg.org/issues/ocl2-rtf.html#Issue9404

Regards,
Linda

Alexander wrote:
> Hi all,
>
> I'm using ocl to validate some uml models. These models, and the ocl
> too, use a lot of profiles. For now I have used getAppliedStereotypes
> etc. But after upgrading to RSA 7.5 these rules don't work anymore.
>
> Using the normal UML Editor nothing is wrong, but with an older RSA/RSD
> version, I could use the same rules, using the same extensionpoint
> method, directly on the emx files.
> I know this isn't a RSA/RSD forum/newsgroup, but I think it has to do
> with the getAppliedStereotypes methods, and now want to use the OCL/UML
> standard extension_StereotypeName method.
>
> In RSA I end up getting a error that there are multiple association ends
> with the same name. Using emf I gen an error that the variable isn't
> recognized.
>
> Is it possible to use extension_ and if so, can I use the stereotype
> namespace using the extension_ mechanism? When using
> getAppliedStereotype the stereotype name would be
> MyProfile::StereotypeName, with extension_StereotypeName as the other way.
>
> TiA!
>
Previous Topic:How to define collection type of variable
Next Topic:When must Query objects be reconstructed?
Goto Forum:
  


Current Time: Wed Oct 22 00:13:15 GMT 2014

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

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