Home » Modeling » Papyrus » How to model restrictions in relationships in UML Profile and stereotype properties
|
Re: How to model restrictions in relationships in UML Profile and stereotype properties [message #1414168 is a reply to message #1413839] |
Sat, 30 August 2014 13:33 |
|
Hi, Alexander,
See some replies in-line, below.
HTH,
Christian
On 2014-08-29 14:56:32 +0000, Alexander Fülleborn said:
> Hello all,
>
> I would like to model restrictions on dependencies between different
> kind of newly created stereotypes in my profile.
OCL constraints should be able to specify these restrictions, and
Papyrus Luna evaluates such constraints in validation of models that
have the profile applied.
> E.g. I have a stereotype of type dependency and a stereotype of type
> class. I now want to model that the 2nd stereotype only can be the
> client of the 1st stereotype and not the target.
Let's call the class stereotype "Client". Then an OCL constraint like
this (totally untried and untested) on the dependency stereotype might
do what you want:
self.supplier->select(oclIsKindOf(uml::Class))->forAll(sup |
sup.oclAsType(uml::Class).extension_Client->isEmpty())
I'm assuming the cast as Class will be needed to resolve the Client
stereotype's metaclass extension end.
> Another issue is the stereotype properties. How are they modeled?
I don't understand the question. They are modeled like any other
properties of a class in a Papyrus UML model, or do you have a more
specific concern about how they work at run-time?
> Thanks a lot for any appreciated support.
>
> Kind regards, Alexander
|
|
| |
Re: How to model restrictions in relationships in UML Profile and stereotype properties [message #1414866 is a reply to message #1414460] |
Mon, 01 September 2014 13:33 |
Camille Letavernier Messages: 952 Registered: February 2011 |
Senior Member |
|
|
Hi,
The new OCL 2.4 selector "->selectByKind(uml::Class)" might simplify the definition of the constraint (You don't need to cast anymore, since it's a mix between select() and oclAsType()).
To display the stereotype properties in the diagram, you need to select a stereotyped element in the diagram, then go to the Properties view, Appearance tab, select the stereotype property and click the "display" button. Then, you can choose to display it in a Compartment (default) or as a Comment ("Display place", in the same tab of the properties view)
Regards,
Camille
Camille Letavernier
|
|
| | | |
Re: How to model restrictions in relationships in UML Profile and stereotype properties [message #1437958 is a reply to message #1437654] |
Sun, 05 October 2014 08:16 |
Klaas Gadeyne Messages: 165 Registered: July 2009 |
Senior Member |
|
|
Walid Ban wrote on Sat, 04 October 2014 16:15Hi
Thank you Klaas for answering..
I know that Luna is better, but it doesn't take account about the shape format of a stereotype, that's why I prefer Kepler...
Doesn't matter, I work on Luna at the same time..
About the second tip, do you mean by OCL Syntax completion, the OCL Xtext assistant (ctrl+ space)? and what is UML spec? sorry, i want to understand this vocabulary.
Yes I mean the OCL syntax completion. UML spec = UML specification.
But looking at your profile, it looks like you've understood this pretty well
Quote:
I uploaded the profile and a model to test the constraint.
Thank you again..
The profile is quite big (which makes it harder to debug/understand).
My first problem with the profile: why do you extend the meta-class Extension to create a ViewExtension stereotype (instead of extending an association)? Are you aware that Extension is a special meta-class, not to be used in a standard model? Or do I miss something in your profile?
Klaas
|
|
| | | | | |
Goto Forum:
Current Time: Wed Apr 24 23:47:34 GMT 2024
Powered by FUDForum. Page generated in 0.03902 seconds
|