Author Topic: Problem adding tagged values to stereotypes  (Read 4416 times)

heba

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Problem adding tagged values to stereotypes
« on: March 10, 2015, 10:31:06 am »
Hi all,

I created a stereotype "MyReq" of a "Requirement" and added some tagged values.  This gives a new tab "MyReq" in the properties window with all the tagged values. Using the automation interface I'm also able to create new requirement objects  into the repository together with the tags.

Now if the requirement object already exists but without that tagged value I'll try to add this using

TaggedValues.AddNew("VALUE1", "MyReq");

This result in adding the tagged value to the "base class", to the "Tags" section but not the other existing tags defined by the stereotype. I also played around with the "type" parameter and used "Requirement::MyReq" and so on but always got the same result.

Does anyone knows what's going on here and what would be the correct call?

Many thanks
Heiko

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Problem adding tagged values to stereotypes
« Reply #1 on: March 10, 2015, 08:46:45 pm »
Instead of adding them manually you need to synchronize the missing stereotypes (depends on the EA version you use). MDG stereotypes have some voodoo in t_xref you can not easily create via the normal API tag addition. See Repository.SynchProfile in the help.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Problem adding tagged values to stereotypes
« Reply #2 on: March 11, 2015, 09:47:41 pm »
Instead of adding them manuall try
Code: [Select]
EA.Element.SynchTaggedValues ("MyProfile","MyRec")
That works specifically on your element, not on all elements that have that stereotype.

Geert

heba

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Problem adding tagged values to stereotypes
« Reply #3 on: March 12, 2015, 05:43:54 am »
That helped, many thanks!

Seems that this function does most of the stereotype cleanup which I intended to do manually :-)

-Heiko

Svend Erik Nygaard

  • EA User
  • **
  • Posts: 131
  • Karma: +2/-2
  • Business Information Architect
    • View Profile
Re: Problem adding tagged values to stereotypes
« Reply #4 on: March 12, 2015, 09:54:53 pm »
It seems to me, that I get the work done easier/better by doing it in the follwoning order (for each individual element:
1) clean up / transform tag names and values
2) EA.Element.SynchTaggedValues
... because the EA.Element.SynchTaggedValues  will attempt to find matching tags.
« Last Edit: March 12, 2015, 09:55:15 pm by svenderiknygaard »