Book a Demo

Author Topic: List of values for TaggedValue and Stereotypes  (Read 3666 times)

stealth02r1

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
List of values for TaggedValue and Stereotypes
« on: May 23, 2005, 03:29:34 pm »
I understand how to create a list of values for a TaggedValue using the (values="element | attribute | both" default="both") syntax. However, when you define TaggedValues for Stereotypes you create the TaggedValue as an attribute of the Stereotype. When doing so how/where do you define the list of values? All I am able to do is specify the initial value. Where would I define the tag details in this case?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: List of values for TaggedValue and Stereotypes
« Reply #1 on: May 23, 2005, 07:30:01 pm »
As well as specifying the Values you need to specify the type as Enum.

So it should be something like this
Code: [Select]
Type=Enum;
Values=Element,Attribute,Both;
Default=Both;

Simon

stealth02r1

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: List of values for TaggedValue and Stereotypes
« Reply #2 on: May 24, 2005, 10:22:32 am »
Thanks for the reply but I am still confused. Let me provide a bit more background to my question. I have created a new stereotype called MyDatatype which extends the Class metaclass. The goal is to be able to define a new class, drag the MyStereotype onto it, and then apply all of the TaggedValues defined for that stereotype to the new class.

I have added an attribute to my stereotype called MyTaggedValue. Now since attributes are TaggedValues when defined in the context of a stereotype - how do I define the details for the TaggedValue?  

Maybe I am just going about this all wrong. If so please enlighten me!

stealth02r1

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: List of values for TaggedValue and Stereotypes
« Reply #3 on: May 24, 2005, 11:50:18 am »
Just to add a bit more...I am creating my stereotype by defining a new class which has a stereotype of stereotype. Then I define "attributes" for that class which are really TaggedValues for that new stereotype.

It looks like the UI is woefully inadequate here. When you define a stereotype in this manner you pretty much need a different UI. Adding attributes to a stereotype doesn't really make sense and most of the fields on the attribute dialog are irrelevant for TaggedValues and get ignored. This was the cause of my confusion.

It looks like I am going to have to go in to my saved UML Profile and modify the XML by hand in order to add the correct values for the TaggedValues in my stereotypes.

Please let me know if there is a better way to accomplish this.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: List of values for TaggedValue and Stereotypes
« Reply #4 on: May 24, 2005, 03:27:55 pm »
Sorry, I misunderstood your question.

The answer I gave wasn't relevent to creating profiles, instead it was creating a tagged value in (Configuration | UML | Tagged Values)

You can do what you want to do using profiles though.

Look at http://www.sparxsystems.com.au/EAUserGuide/index.html?addingenumerationstagstost.htm for details of adding enumerations to your profile.  I'll just give a brief summary here.

Drag an Enumeration from the Profile Toolbox, and add to it the attributes representing the enumeration values.

Then in your stereotype, set the type of the attribute to be that enumeration.

Finally, set the default value as you did before.

That should work for you.

Simon

Chris Tatem

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: List of values for TaggedValue and Stereotypes
« Reply #5 on: December 04, 2007, 02:47:21 pm »
I have tried this, and other techniques today and am stuck.  I have a profile that I import (Resources) into a model.  I can create my new element (in my case from the profile a Business Process) and I can see the associated tagged value (Process Level; values = One, Two; default=One).  however, I don't get a drop down list, in fact I can't even edit the value of the tagged value.  If I set the type of the attribute to string, I can enter whatever I want.

My profile has a a Business Process stereotype, extended from a metaclass with an attribute Process Level.  This attribute is of type: pTypes; Initial Value: one; no stereotype; Scope: public.  pTypes is an enumeration with the attributes of One and Two.

What did I miss?

thanks

cwt