Sparx Systems Forum
Enterprise Architect => Uml Process => Topic started by: Philipp91 on December 24, 2020, 05:28:21 am
-
Hello everyone,
I created a stereotype with the name device type. I added the stereotype device of type devices. Devices is a class diagram on my profile
which allows the user to add 4 values on the tag value device. The figure is shown in the following screenshot.
https://paste.pics/900eb86a7ebf5be14ecec44874910c5f
However I would like the number of values the user can add on this tag value to be arbitrary and not a fixed number as 4. So i tried to make the following as can be seen in the screenshot
https://paste.pics/9c6087da9af8816660bba59a2ac2ffdc
So i created a second stereotype test2 and added the tag value device of type device types and added an association between them the device types can be from 1 to many. However it does not work..You guys have any idea if something like this is possible, and if yes how to achieve it?
Kind Regards,
Philipp
-
No, I don't think you can do that with tagged values.
It feels like you are trying to model things in the meta model which might belong in the model itself. (e.g. use relations between elements instead of tagged values to model the relation between devices and device type)
Geert
-
hmm I think it is possible I just don't know how..Because in the first screenshot i sent it worked. I created the profile defined class and was able to add on the same attribute/tag value more than one attribute. However as i mentioned my problem is the upper bound(limitation), that I have manually to add how many values the attribute can take so I just need a way to say keep it flexible the number of values the user can add on an attribute.
In the second screenshot i tried to use relation between the elements(by adding the association) but it did not worked..Can you elaborate more what you mean with relations between elements and how to use them?
Kind Regards,
Philipp
-
You 2nd one is just nonsense and the first missed the <<taggedvalue>> stereotype for the connector.
q.
-
Qwerty, what you mean it missed the <<taggedvalue>>?
I also think I did not explain my problem well enough. Let me try again.
So I created the following stereotype "Orange Type" which extends the metaclass class for defining different types of oranges.
This stereotype has a tag value orange of type Orange(see figure).
https://paste.pics/56d8cd7fe7d93e5bc4b9bf84200eaee3
So after creating this stereotype i applied on the class17(see figure) and I am able to add it 4 individual values for the tag value orange, blue,black, red, orange. (see figure)
https://paste.pics/376c38e1b45887205e0bb3f8c626288e
So my question is I don't want to be limited to a fix number of values(in our case 4). I want it to be flexible and the user to add as many he wants in the class with the stereotype orange applied on it.
So qwerty, I tried different ideas and on of them was the 2nd one which was more to demonstrate and try to explain my issue.
I hope the orange example is more clear. Any tip how i can achieve that?
Kind Regards,
Philipp
-
You can't. Stereotype properties (aka tagged values) are fixed when you define a stereotype (as the name says: its properties). What would be your application in practice? Orange properties being other colors is not an example that makes any sense. Even less having a multitude of those.
q.
-
The example is a nonsense one just to focus on the problem. I know the tagged values are fixed, but i defined a tag value of type Orange and that gave me the option to add the different color as seen in screenshot 2. I would like the user to be able to add as many colors he wants not just 4(a fixed number).
In my case i want to make a stereotype called "Device" with attribute "devices" and then the user can add in this attribute as many devices he wants from one to many. (as many colors he wants in case of the orange example).
Any hope with achieving something like this??
Kind Regards,
Philipp
-
Philip,
If you have a device that can have many other devices, you generally model that as elements, using relations such as composition between the devices.
That is not something you should try to model using tagged values.
Geert
-
Geert,
you mean to model every device with a class for example? Actually the whole picture is much bigger, so I actually
need to have the stereotype <<device>> with the tag value the devices. That cannot change..
So there is no way to have an arbitrary and not a fixed number of the values that can be added on the tag value devices?
Kind Regards,
Philipp
-
Hello,
You can use a RefGUIDList to assign as the values of a tag a number of elements of certain types and stereotypes.
It's a bit clunky and requires you to create elements for the things you want to use as tagged values, but it works.
/Uffe
-
Hello,
You can use a RefGUIDList to assign as the values of a tag a number of elements of certain types and stereotypes.
It's a bit clunky and requires you to create elements for the things you want to use as tagged values, but it works.
/Uffe
Also IIRC, there's a limit to the number of characters in the field and thus the number of GUIDs that can be set (6, I think)
Paolo
-
256/<length of GUID> (being {XXXXXXXX-XXXX-xxxx-XXXX-XXXXXXXXXXXX} that's 41 plus one separator = 42) is about 6 with little space left.
q.
-
256/<length of GUID> (being {XXXXXXXX-XXXX-xxxx-XXXX-XXXXXXXXXXXX} that's 41 plus one separator = 42) is about 6 with little space left.
q.
My GUID columns are all char(38) 8+4+4+4+12 (+4"-" and 2"{}") add in the separator
Still only 6 though...
Paolo
-
I actually did not look into the DB but made just a rough calculation to verify that your 6 is correct.
q.
-
Another option is to work with "loose" tagged values.
Manually you can add as many tagged values of the same type as you want.
Make sure the option "show duplicate tags" is on though, or EA will only show one of them.
Geert
-
Another option is to work with "loose" tagged values.
Manually you can add as many tagged values of the same type as you want.
Make sure the option "show duplicate tags" is on though, or EA will only show one of them.
Also, if you need too access the tagged value contents in scripts and/or document generation, it gets tricky. The same goes for RefGUIDLists (although the single RefGUID is simpler to deal with).
Basically what we are all saying here is you're going out on a limb of EA functionality and should consider your metamodel and how to implement it.
But I should also add for completeness that the RefGUIDList I mentioned is the same thing as a one-to-many tagged value connector in the profile. So that's what you were trying to do I think, but you didn't use the correct connector.
/Uffe
-
Hey Guys, thanks for the replies!
I read about the RefGUIDList. However, I am also using shape scripts and how I understood it won't be easy to use both of them together.
I will try to do it maybe with "loose tagged values"
Uffe,
which connector can I use as a one-to-many tagged value in the profile? It is exactly what I am trying to do..can you show me an example?
Kind Regards,
Philipp