Author Topic: Moving tag from one stereotype to another  (Read 5631 times)

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Moving tag from one stereotype to another
« on: August 09, 2018, 07:33:02 pm »
We plan to relocate some tags. It looks, according to my tests, that it's enough to sync stereotypes and everything will be ok. Is there any other impact I should know bout?

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Moving tag from one stereotype to another
« Reply #1 on: August 09, 2018, 07:42:55 pm »
I doubt if the tagged values for which you have set some value (other than default) will be removed, it will only be moved from the MDG profile to normal tags.

Whilst Synchprofile will add, for removing any applied tags, a script must be used.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #2 on: August 10, 2018, 09:54:50 am »
Concur with Nizam a script to remove existing tagged values.
There is a script in the topic url below to add tagged values which could be modified to remove tagged values.
https://www.sparxsystems.com/forums/smf/index.php/topic,40259.0.html

Pre-requist: You'll need to have skills in JavaScript.
Happy to help
:)

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #3 on: September 10, 2018, 08:45:54 pm »
I don't understand, what I need a script for. Here is my scenario:
I have two stereotypes ST_A, ST_B, which are assigned to all tables. ST_A owns two  tags, TV1 and TV2. Now I edit profile and move TV2 from ST_A to ST_B. When I open the model, I see TV2 as a standalone tag (not under a stereotype but under the table class). After synchronizing the ST_B stereotype I see the TV2 under it. It retains it's original value, even non-default.
Do you see something that I missed and could be a issue?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #4 on: September 10, 2018, 10:26:34 pm »
"relocate tags" is a very rough description and leaves room for lots of interpretation. What is the reason for doing it? What exactly shall be the outcome?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Moving tag from one stereotype to another
« Reply #5 on: September 10, 2018, 11:13:42 pm »
I don't understand, what I need a script for. Here is my scenario:
I have two stereotypes ST_A, ST_B, which are assigned to all tables. ST_A owns two  tags, TV1 and TV2. Now I edit profile and move TV2 from ST_A to ST_B. When I open the model, I see TV2 as a standalone tag (not under a stereotype but under the table class). After synchronizing the ST_B stereotype I see the TV2 under it. It retains it's original value, even non-default.
Do you see something that I missed and could be a issue?

I think that is fine like that.
If you were to move tagged values from one element (table) to another (e.g. package), then you would need a script.

Geert

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #6 on: September 11, 2018, 01:10:27 am »
No no, it is not to move the tag from one element to another but from one stereotype to another stereotype. And both stereotypes are present on all the tables in the model. So the tag will stay on all the tables too.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #7 on: September 11, 2018, 07:28:08 am »
Just rename the stereotype and you should be done.

But to rename the stereotype you have to do that for all stereotyped elements. Without a script you will have a hard time.

You "could" go directly to the database. But that would probably have the need for doing awkward string manipulations in t_xref.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #8 on: September 11, 2018, 09:18:54 am »
No no, it is not to move the tag from one element to another but from one stereotype to another stereotype. And both stereotypes are present on all the tables in the model. So the tag will stay on all the tables too.
Each tagged value that comes from a profile is uniquely identified, including the stereotype that it comes from. If you move the tagged value definition to the supertype of its current stereotype that will still change. The result is that any existing tags will no longer match the definition, they will then appear to be not from any profile because they don't match any available tag definition.

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #9 on: September 12, 2018, 01:18:06 am »
Have you read my yesterday's post, where I described my scenario? For me, the result is ok - the moved tag is displayed under the new stereotype (ST_B) instead of the original stereotype (ST_A). And this was the purpose. So where is the problem?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Moving tag from one stereotype to another
« Reply #10 on: September 12, 2018, 08:59:40 am »
I was talking about the impact such a change would have on the existing tagged values for elements with those stereotypes already applied. You can probably correct that by running a synchronize stereotype though.