Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to define a stereotype which subsets a meta-class association / redefine an attribute
How to define a stereotype which subsets a meta-class association / redefine an attribute [message #958950] Fri, 26 October 2012 10:43 Go to next message
Andrea Sindico is currently offline Andrea Sindico
Messages: 266
Registered: November 2010
Senior Member

I'd like to define a stereotype which extends the Class meta-class and redefines the ownedBehavior attribute so that it can only takes Activities. I guess one way to do that is via OCL but I can't see the Constraints tab in the Properties View. Plus I would like the editor to only allow the instantiation of activities if the stereotype is applied. Should I do that by means of "static" profiles?

Follow me on Twitter @andreasindico

Re: How to define a stereotype which subsets a meta-class association / redefine an attribute [message #959013 is a reply to message #958950] Fri, 26 October 2012 11:35 Go to previous message
Camille Letavernier is currently offline Camille Letavernier
Messages: 483
Registered: February 2011
Senior Member
Hello Andrea,


The only way to restrict the UML specification with profiles is to add constraints. You should distinguish two things:


- The model validation
- The tooling


With the generic Papyrus environment, you can not prevent the user from adding any kind of behavior in a Class. However, what you can do is to say "this is invalid", by implementing a new constraint.

It is the responsibility of the tools to actually prevent from even trying to create a non-activity behavior in a stereotyped Class. And most Papyrus tools can be extended (e.g. palette, properties view...)

Currently, this is not well supported. Constraints can be defined in a profile, but it is not yet possible to actually take these constraints into account when validating the model. And some tools (e.g. Modeling Assistants, "New child" from the ModelExplorer, ...) cannot be (easily) customized yet.


Regards,
Camille


Camille Letavernier
Papyrus developer
Previous Topic:MARTE Palette
Next Topic:Problem with applied profiles
Goto Forum:
  


Current Time: Sat Oct 25 00:07:26 GMT 2014

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

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