Book a Demo

Author Topic: Tagged Values on Attributes  (Read 4671 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Tagged Values on Attributes
« on: October 16, 2019, 01:38:08 pm »
Heyo

I have created a stereotype based on the metaclass Attribute and then added a tagged value to that stereotype.
However, when I create an instance of that stereotype from the toolbox, no tagged values.

Is this something that is possible?

Cheers

Jays :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Tagged Values on Attributes
« Reply #1 on: October 16, 2019, 02:22:25 pm »
Sure that is possible, I do that all the time.
Something must have gone wrong when exporting your profile or generating your MDG.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Tagged Values on Attributes
« Reply #2 on: October 16, 2019, 02:32:56 pm »
Did you create tagged values on your stereotype or attributes?

Attributes on a stereotype define the tagged values created when the stereotype is applied.

rupertkiwi

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Tagged Values on Attributes
« Reply #3 on: October 16, 2019, 04:04:44 pm »
How do you define attributes in the profile that are applied when the stereotype is applied?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Tagged Values on Attributes
« Reply #4 on: October 16, 2019, 05:12:14 pm »

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Tagged Values on Attributes
« Reply #5 on: October 17, 2019, 04:14:23 am »
Okie dokie, I MUST be really stupid! LOL!

I used the Stereotype Profile Helper and set the metatype as Attribute and it (appears) to be the same as what it was when I did it manually.
After re-generating and re-importing the MDG it looks the same.

I create a class, then drag my Attribute stereotype onto the class and I still can't see where the tagged value is.

Maybe I am looking in the wrong place for the tagged value on an attribute? I am clicking on the attribute and expecting it to be in the Attribute Properties pane just like tagged values for Elements appear in the Element Properties box.

Cheers

Jays :-)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Tagged Values on Attributes
« Reply #6 on: October 17, 2019, 05:18:53 am »
Actually I seem to be having issues setting tagged values on both attributes and connectors.
The XML for the attribute from the MDG file is:

<Stereotype name="AnAttribute" notes="" cx="0" cy="0">
   <AppliesTo>
   <Apply type="Attribute"/>
   </AppliesTo>
   <TaggedValues>
            <Tag name="Greetings" type="" description="" unit="" values="" default=""/>
   </TaggedValues>
</Stereotype>

The XML for the connector from the MDG file is:

<Stereotype name="TestConnector" notes="" cx="0" cy="0">
   <AppliesTo>
      <Apply type="Association">
         <Property name="compositionKind" value="none"/>
         <Property name="direction" value="Source -&gt; Destination"/>
      </Apply>
   </AppliesTo>
   <TaggedValues>
      <Tag name="Taggy" type="int" description="" unit="" values="" default=""/>
   </TaggedValues>
   <DiagramProperties>
      <DiagramProperty name="Proppy" option="" default="1"/>
   </DiagramProperties>
</Stereotype>

Any idea where my stupidity lies?

Cheers :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Tagged Values on Attributes
« Reply #7 on: October 17, 2019, 02:28:50 pm »
Did you add the tagged values with the profile helper as well?
Or did you add them "manually" as attributes?

Geert

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Tagged Values on Attributes
« Reply #8 on: October 25, 2019, 04:40:20 am »
Hey Geert

So I have edited the attribute I have created using the profile helper and when I click on the Status tagged value in the helper. it displays correctly that Status is of type Enum with three possible values (Current, Future & Deprecated) and an initial value of Future.
The XML from the mdg file is as shown below.

I have then created a toolbox button for the "AnAttribute" stereotype.
When I drag AnAttribute onto another element, it prompts me for the name and type of attribute (i.e. integer) but nowhere can I see where to set the value of the Status tagged value.

Is this because I just don't know where to look or something more fundamental?

Cheers :-)

-<Stereotype notes="" name="AnAttribute" cy="0" cx="0">
-<AppliesTo>
<Apply type="Attribute"/>
</AppliesTo>
-<TaggedValues>
<Tag name="Status" type="Status" default="Future" values="" unit="" description=""/>
</TaggedValues>
</Stereotype>


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Tagged Values on Attributes
« Reply #9 on: October 25, 2019, 03:13:50 pm »
In v15 the MDG profile tagged values are found in the properties window.

You should see a section with the name of your MDG.

Alternative is to look in the attribute dialog (select the attribute in the project browser and press F9)
There is a tagged values section in there that should show all tagged values.

Maybe also try a different name for you tagged value (e.g. "myStatus") I can imagine "Status" being treated differently as sort of a reserved word.

Geert