Book a Demo

Author Topic: how to get rid of multiple tags?  (Read 4105 times)

ngong

  • EA User
  • **
  • Posts: 275
  • Karma: +2/-2
    • View Profile
how to get rid of multiple tags?
« on: April 09, 2021, 01:55:20 pm »
Somehow - I guess by updating and repeated importing of the same profile - I got multiple tags at elements of certain stereotype.
In the Properties window this looks like this.

How to reduce each tag to appear only ones?
Rolf

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how to get rid of multiple tags?
« Reply #1 on: April 09, 2021, 02:39:33 pm »
You'll have to delete the one you don't need. I guess a little script would be the best approach to deal with this if you have more than a couple of these elements.

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: how to get rid of multiple tags?
« Reply #2 on: April 10, 2021, 12:07:45 pm »
Geert is correct a script is probably the best way to do it.
See elements extras example in JScript or VB Script under Local Scripts to see how to delete tagged values
You'll need to recursively navigate the model and there is an example of how to do that in Recursive Model Dump example.
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how to get rid of multiple tags?
« Reply #3 on: April 10, 2021, 04:31:51 pm »
Geert is correct a script is probably the best way to do it.
See elements extras example in JScript or VB Script under Local Scripts to see how to delete tagged values
You'll need to recursively navigate the model and there is an example of how to do that in Recursive Model Dump example.
I don't recommend to recursively navigate the model, that will take ages for a non-trivial model.
Much better to write a query that returns the elements you need to change, and then use Repository.GetElementSet() with your query (and parameter "2")
While deleting tags, make sure you iterate them backwards.

Geert