Author Topic: Attribute/tag value with more than one values  (Read 23604 times)

Philipp91

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Attribute/tag value with more than one values
« 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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13286
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Attribute/tag value with more than one values
« Reply #1 on: December 24, 2020, 05:58:01 am »
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

Philipp91

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #2 on: December 24, 2020, 06:13:02 am »
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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #3 on: December 24, 2020, 07:18:18 am »
You 2nd one is just nonsense and the first missed the <<taggedvalue>> stereotype for the connector.

q.

Philipp91

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #4 on: December 25, 2020, 12:42:23 am »
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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #5 on: December 25, 2020, 03:39:24 am »
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.

Philipp91

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #6 on: December 25, 2020, 04:53:37 am »
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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13286
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Attribute/tag value with more than one values
« Reply #7 on: December 25, 2020, 07:02:11 am »
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

Philipp91

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #8 on: December 26, 2020, 03:12:20 am »
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

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #9 on: December 26, 2020, 03:34:34 am »
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
My theories are always correct, just apply them to the right reality.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8598
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #10 on: December 26, 2020, 10:54:47 am »
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
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #11 on: December 26, 2020, 11:01:02 am »
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.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8598
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #12 on: December 26, 2020, 12:12:05 pm »
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
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Attribute/tag value with more than one values
« Reply #13 on: December 26, 2020, 07:17:22 pm »
I actually did not look into the DB but made just a rough calculation to verify that your 6 is correct.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13286
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Attribute/tag value with more than one values
« Reply #14 on: December 26, 2020, 07:30:49 pm »
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