Home » Modeling » UML2 » RE: steretype on multiple different attributes
RE: steretype on multiple different attributes [message #1852559] |
Mon, 23 May 2022 12:54  |
Eclipse User |
|
|
|
Hi,
I am trying to use stereotypes to define unique indexes on a Class's properties.
An index can span over multiple properties.
Eg,
Class: Person {firstName, lastName, nickName, idNumber}
I'd like to create 3 unique indexes on Person.
1) [firstName, lastName]
2) [nickName]
3) [idNumber]
I know how to create a stereotype on Person that allows me to define one index, but how to do multiple unique indexes.
I tried to create a new Class called "Index" with an array or properties in the profile but I have no idea of to create the "Index" when applied to my model?
Is this possible?
Thanks
Pieter
|
|
| | | | |
Re: RE: steretype on multiple different attributes [message #1852584 is a reply to message #1852583] |
Wed, 25 May 2022 04:34   |
Eclipse User |
|
|
|
Hi,
Quote:
I added the composite association but for some reason its not instantiating the "Index"
The only way I can manage to get to add properties is to add properties directly to the "Indexed" Stereotype.
Yes, I forgot to tell you that when you create the association you have to be sure that the composite member end is owned by the stereotype class, otherwise Papyrus doesn't show it.

Quote:
In your example, does the "Index" get created when applying the Stereotype.
If so, how do you create a second and third "Index"?
No, the "index" doesn't get created automatically, I created it by hand using the Papyrus toolbar at the right panel, similarly for the second and third indexes.

I have discovered all of this by trial and error, I do not know if this is documented somewhere in Papyrus. But my profiles are much simpler than what you want to achieve, so perhaps you should ask for further details directly in the papyrus forum
Regards
German
|
|
| | | |
Goto Forum:
Current Time: Fri Jul 18 20:10:11 EDT 2025
Powered by FUDForum. Page generated in 0.07332 seconds
|