Book a Demo

Author Topic: Multi value/selection tagged value  (Read 9166 times)

RRushing

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Multi value/selection tagged value
« on: July 12, 2013, 06:39:53 am »
I want to be able to add a tagged value to a Stereotyped Requirement created as a Profile...basically so that I can select multiple capabilities that would apply to the requirements.....basically ability to select multiple items in a tagged value....I've read that using RefGUIDlist works...but all of the examples given on-line give examples with skipping major parts of the example...for instance I found this online

The xml would look like this when defining the tagged value as part of a stereotype:

<Tag name="locationMetric" type="locationMetric" description="List of activity metrics by location" unit="" values="" default=""/>

You then need to define under taggedvalue type, ie locationMatric in this case under a TaggedValuesTypes section:

<TaggedValueType property="locations" description="" notes="Type=RefGUIDList;Values=Class;Stereotypes=Location;BaseStereotype=LocationMetric;"/>

Note the use of RefGUIDList, this is what allows the selection of multiple 'Locations' in this instance. Try searching on RefGUIDList in the help....


it doesn't indicate where I define any of this...I'm thinking that "locationMetric" is a profile of type class?  does it contain any attributes? if so, what are they how are they defined.....

with the taggedvaluetype.....I dont understand where the stereotype 'locations" is coming from

Help!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Multi value/selection tagged value
« Reply #1 on: July 12, 2013, 09:35:29 am »
1. Go Settings > UML Types > Tagged Values Types and create a new tagged value type called "locations" with detail "Type=RefGUIDList;Values=Class;Stereotypes=Location;"
2. Create a package with «profile» stereotype. Give it a diagram.
3. On the diagram, drop a stereotype element with an extends association to a metaclass element. When the dialog appears for the metaclass, choose "Requirement".
4. Give the stereotype class an attribute named "locations".
5. Save the profile.
6. Go Tools > Generate MDG Technology File and follow the wizard's instructions. When asked what to include in the technology, tick the options for Profiles and Tagged Value Types. Select the profile saved in step 5 and the tagged value type saved in step 1.
7. Go Settings > MDG Technologies > Advanced > Add > Add Path and add the path where you saved your technology file.
8. Find your profile in the toolbox and drop a stereotyped requirement on a diagram: it should have your RefGUIDList tagged value.
« Last Edit: July 12, 2013, 09:37:25 am by KP »
The Sparx Team
[email protected]

RRushing

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Multi value/selection tagged value
« Reply #2 on: July 13, 2013, 12:45:03 am »
Thanks...got this to work...unfortunately didn't give me what I want...which is to have a tagged value that has 1.....n values

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multi value/selection tagged value
« Reply #3 on: July 15, 2013, 04:20:19 pm »
You could add multiple tagged values of the same type to indicate the different values.

It wouldn't be UML compliant, but it would work.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multi value/selection tagged value
« Reply #4 on: July 15, 2013, 04:58:17 pm »
Quote
You could add multiple tagged values of the same type to indicate the different values.

It wouldn't be UML compliant, but it would work.

Geert
I'll argue that it is UML compliant.

All you are doing is putting multiple values into a single named property. It's simply a matter of presentation that each appears as a separate value instead of having a single list.

You'll also find that Sparx Systems used that behavior to model multiple labels on RDF/OWL classes (in the ODM technology).

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multi value/selection tagged value
« Reply #5 on: July 15, 2013, 05:17:34 pm »
Having multiple values (separated by ";" or whatever) in a single tagged value surely is UML compliant.

Having multiple tagged values with the same name on a single element is not. (IIRC)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Multi value/selection tagged value
« Reply #6 on: July 15, 2013, 05:45:08 pm »
I was curious and scanned through some of the latest Superstructures. But I was not able to find any reasonable definition for Tagged Values at all.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multi value/selection tagged value
« Reply #7 on: July 15, 2013, 06:18:50 pm »
Quote
I was curious and scanned through some of the latest Superstructures. But I was not able to find any reasonable definition for Tagged Values at all.

q.

I know. I remember to have found something that indicated that the name of a tagged values should be unique within an element, but I don't really know here exactly I found that information. The UML specification could be easier on that part. I guess it has to be in the profiles section somewhere (since tagged values can only exist within the context of a profile since UML v2.0)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Multi value/selection tagged value
« Reply #8 on: July 15, 2013, 09:40:06 pm »
I wouldn't say Superstructures is rubbish. But from a scientific view it has at least heavy defects. The worst is that it does not even have a glossary. Lots of the releases are just delta-docs without showing that prominently. If I had to give points out of 10 (for 10 being the optimum) Superstructures would be at 4.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multi value/selection tagged value
« Reply #9 on: July 16, 2013, 09:05:25 am »
Geert, my point is that all UML specifies is that a stereotype provides a named property. For the purposes of this discussion the property specifies that it has a multiplicity of 1..*.

Any instance of that stereotype now has a slot with that name that can take 1..* values.

It doesn't make any mention of how those values should be displayed.

It could be:
value1,value2,value3
value1;value2;value3

But I don't see a reason why it couldn't be:
property=value1
property=value2
property=value3

Furthermore, if you look at valid XMI serializations for such a property I would expect to see something like:
Code: [Select]
<MyProfile:myStereotype base_Class="_0" property="value1,value2,value3" />or

Code: [Select]
<MyProfile:myStereotype base_Class="_0">
     <property xmi:type="http://www.omg.org/spec/UML/20110701/UML.xmi#String" value="value1"/>
     <property xmi:type="http://www.omg.org/spec/UML/20110701/UML.xmi#String" value="value2"/>
     <property xmi:type="http://www.omg.org/spec/UML/20110701/UML.xmi#String" value="value3"/>
</MyProfile:myStereotype>

My understanding is that both are perfectly valid.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multi value/selection tagged value
« Reply #10 on: July 17, 2013, 03:59:49 pm »
Hi Simon,

I see your point.
If your interpretation is indeed correct (and I don't have any reasons to doubt that) then all the better.
That would mean our model is even more UML compliant then I thought :)

Geert