Author Topic: Using the API to adda Profiled Tagged Value  (Read 673 times)

philchudley

  • EA User
  • **
  • Posts: 560
  • Karma: +11/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Using the API to adda Profiled Tagged Value
« on: May 09, 2018, 07:18:37 pm »
Hi All

Please excuse if this has been asked before, but I did a search and could find the answer I am seeking.

Let's say I have defined an MDG called MyMDG.

I also have an extension that is managing elements created using stereotypes defined within the MDG.

I now wish to create an ad-hoc tagged value within the extension that is included on the MyMDG tab for the tagged values. Here's what I have got

newTag = myElement.TaggedValues.AddNew("MyMDG::My Tag", "");

This adds the tag correctly and it shows in the MyMDG tab BUT, the tag name shows as MyMDG::MyTag, rather than MyTag

How can the prefix of the MDG name be removed?

I have tried

a) adding to TaggedValuesEx - same effect
b) stripping off the MDG prefix from the tag name after it has been added - moves the tag to the Tag tab

Any ideas?

Thanks

Phil
follow me on Twitter

@SparxEAGuru

qwerty

  • EA Guru
  • *****
  • Posts: 10395
  • Karma: +229/-178
  • I'm no guru at all
    • View Profile
Re: Using the API to adda Profiled Tagged Value
« Reply #1 on: May 09, 2018, 08:12:23 pm »
You can not do that. AddNew will take just a string, not a FQN. You either have a TV defined in the MDG or you don't. Ad-hoc are always part of the "basic EA profile".

q.

philchudley

  • EA User
  • **
  • Posts: 560
  • Karma: +11/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Using the API to adda Profiled Tagged Value
« Reply #2 on: May 09, 2018, 09:50:03 pm »
Thanks, that clarifies this issue

I'll report back to my client who wants this feature to tell them its just not possible.

Phil
follow me on Twitter

@SparxEAGuru

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9213
  • Karma: +245/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Using the API to adda Profiled Tagged Value
« Reply #3 on: May 10, 2018, 02:57:05 am »
Thanks, that clarifies this issue

I'll report back to my client who wants this feature to tell them its just not possible.

Phil
Phil,

If it's defined in a profile on the stereotype of this element, but the element doesn't have said tagged value then you need to update the stereotype.
You can do that manually by right clicking on the stereotype on a toolbox, or do it in a script.

If it's not supposed to be on the stereotype of that element then you can't "force" it to be there.

Geert