Author Topic: Tags are deleted when I remove stereotype (MDG)  (Read 3221 times)

Svend Erik Nygaard

  • EA User
  • **
  • Posts: 128
  • Karma: +1/-1
  • Business Information Architect
    • View Profile
Tags are deleted when I remove stereotype (MDG)
« on: August 12, 2014, 08:30:58 pm »
I have created Stereotypes in MDG.
When I remove/change the stereotype on an element in my model, it looses the tagged values associated with the stereotype.
In the MDG I have derived stereotypes, e.g.:
ResourceObj specializes BusinessObj which specializes Obj which extends Class.
Obj carries the tags which are common for all aobjetcs etc.
My problem is, if a user changes/removes the stereotype on an element, all the tagged values are delted - and often the user wants to keep/transfer the tagged values.
Or maybe the user just removed the stereotype from the element by an accident.
Is there a way around this issue?
(In the old days, when I just used UML profiles (in EA v. 7), EA kept any old tagged values. That might leave some mess, but better for me to clean up via scripts, than loosing the tagged values)

qwerty

  • EA Guru
  • *****
  • Posts: 10393
  • Karma: +229/-178
  • I'm no guru at all
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #1 on: August 12, 2014, 09:22:10 pm »
I just tried with the newest build and it looks like you have bad luck. I thought having seen EA to keep the TVs once they are assigned (pretty sure, but my memory...). But a test revealed that 1107 removes all TVs regardless of whether they had been modified or not. I think that this is no good behavior. As you said, if one changes the stereotype by accident then EA removes all TVs! I'd regard that as a bug. At least a warning must be issued to tell the user that changing the stereotype will remove the TVs.

You should send a bug report!

q.

P.S. Just tried with V10 and V9.3. V10 shows the same behavior as V11 so my memory seem to have deceived me. In V9.3 TVs are permanent. Changing the stereotype keeps the TVs.
« Last Edit: August 12, 2014, 09:28:06 pm by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6721
  • Karma: +63/-6
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #2 on: August 13, 2014, 09:07:59 am »
It's intentional behavior added to EA 10. The only way to prevent it (that I can think of right now) would be to directly remove the stereotype via sql, which I don't recommend.
Eve

support@sparxsystems.com

qwerty

  • EA Guru
  • *****
  • Posts: 10393
  • Karma: +229/-178
  • I'm no guru at all
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #3 on: August 13, 2014, 06:49:28 pm »
I could think of a solution that you check the OnContext event save/restore TVs with the stereotype change. Not sure about that as I remember it was not that easy to get the real pre/post change values.

@Simon: I guess that this change was intentional. Nevertheless you have introduced a side effect which is unwanted (as I see it). If a stereotype is changed AND TVs are present which are going to be removed then the user MUST receive a confirmation note!

q.

Svend Erik Nygaard

  • EA User
  • **
  • Posts: 128
  • Karma: +1/-1
  • Business Information Architect
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #4 on: August 20, 2014, 12:15:06 am »
@Simon: This is quite an issue for the use of EA in my Company (CPH Airport) - and we don't see any work-around for it. I really don't know what to do on this - we are in trouble!

@qerty: Thanks for the input. OnContext event - I don't know it, it seems to be something that Add-Ins can use - but I don't write Add-Ins.
Can I use it in EA scripting (JScript)? - I do write EA scripts.

qwerty

  • EA Guru
  • *****
  • Posts: 10393
  • Karma: +229/-178
  • I'm no guru at all
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #5 on: August 20, 2014, 01:04:06 am »
Quote
@qerty: Thanks for the input. OnContext event - I don't know it, it seems to be something that Add-Ins can use - but I don't write Add-Ins.
Can I use it in EA scripting (JScript)? - I do write EA scripts.
I guess you are right in your assumption. AFAIK you can use that only in an add-in.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6721
  • Karma: +63/-6
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #6 on: August 20, 2014, 10:56:20 am »
Yes, the change was intentional. As far as UML is concerned tagged values are the instances of properties owned by the stereotype. If you remove the stereotype they don't exist.

What EA is doing now is correct from a UML perspective. You could argue that prompting would be appropriate. My opinion is that for most users that would just get in the way.

The main situation where I can see wanting to migrate the values is if two stereotypes have a common parent that defines common tagged values. Unfortunately, I believe that values are still lost in this situation.

If you want stereotypes that don't belong to a stereotype, EA allows them to be created.
Eve

support@sparxsystems.com

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1222
  • Karma: +13/-4
  • Read The Help!
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #7 on: August 20, 2014, 12:28:46 pm »
It would perhaps be helpful to know why you would set up extended elements in an MDG and then, apparently as a significant action, want to take the defining stereotype away again.

As Simon meant to say, if you want Tagged Values that don't belong to a stereotype, EA allows them to be created. You can define the element containing them in an element template, so that when you drag the (non-stereotyped) element type from the Toolbox it uses the template as a reference and includes the Tagged Values.

If someone deletes a stereotype by accident, I think you can restore the stereotype and the Tagged Values by dragging the stereotyped element from the Toolbox over the 'broken' element in a diagram.
Best Regards, Roy

Svend Erik Nygaard

  • EA User
  • **
  • Posts: 128
  • Karma: +1/-1
  • Business Information Architect
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #8 on: August 21, 2014, 12:03:53 am »
@Simon: ”Intentional … UML … owned by the stereotype”:
But I guess that does not prevent a UML solution (e.g. EA) to add a feature of saving ’orphan’ tagged values (and possibly even trying to convert them into the new tagged values belonging to the new stereotype. It could be an option in the settings.

@Simon: ”… two stereotypes have a common parent …”
Well actually this depends:
If you choose the new stereotype from the drop-down-box in the properties window – then the tagged values with common namespace actually do survive.
If you dragt it from the tool box and “Apply …” it, then it adds the new stereotype (the element now having two steretypes). Sometimes the new stereotype becomes the last stereotype in the stereotype list for this element – sometimes not, I haven’t figured out how this works. This is actually one reason why users often delete the old stereotype from an element - before they apply a new stereotype for the element.

@RoyC: ”why … take the defining stereotype away again”.
Well two quick and not-totally-fair [ch61514] answers (1 and 2), but still worthy of consideration – and then some more reasons 3-5:
1: not-totally-fair answer (but still worth considering): well – why is it possible to change the stereotype of an element? – I guess in some ways, that’s the same question (even for MDG-stereotyped elements)
2: Likewise: why is it made possible to change even the type of an element (Advanced -> change type)
3: it also happens by accident – and even though it may not be very often its impact increases by the fact that the user often does not notice, that all the tagged values have disappeared. There may be 20 tagged values which each represents considerable analysis time and interview time with business people.
4: Sometimes, users want/need to change stereoypes simply because they get more clarified of what they/others really are talking  about (during an analysis phase quite a lot of concepts can be very abstract/fussy initially). Usually this does not lead to a change in stereotype, but it does happen. I guess this scenario is part of point 1 and 2.

@RoyC: ” If someone deletes a stereotype by accident … you can restore … Tagged Values by dragging the stereotyped element from the Toolbox over the 'broken' element in a diagram."
No. The earlier specified values are not restored (the tags are restored, of course, and with default values, but the actual values are not restored)


qwerty

  • EA Guru
  • *****
  • Posts: 10393
  • Karma: +229/-178
  • I'm no guru at all
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #9 on: August 21, 2014, 02:17:28 am »
Quote
YWhat EA is doing now is correct from a UML perspective.
Object Management Group (OMG - what an acronym) is not really helpful to users in some of their concepts (I won't start arguing here). And EA already has some areas where it has it's own flavor (be it for whatever reason). I guess it would not hinder a tool provider to control that behavior with some flag (here in Tools/Options) which will turn on asking on demand. And definitely that would be helpful to more users than being not. I bet a six-pack of beer agains an old VW Bus that just most of the users have not yet noticed that side effect but will only wonder in the short future where various TV data entries were lost. :P

q.
« Last Edit: August 21, 2014, 02:21:51 am by qwerty »

Svend Erik Nygaard

  • EA User
  • **
  • Posts: 128
  • Karma: +1/-1
  • Business Information Architect
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #10 on: August 26, 2014, 08:59:08 pm »
Quote
It would perhaps be helpful to know why ...

Quote
...

Hi Simon M and RoyC, am I too optimistic to hope that your silence indicates that you are considering what to do about this?

qwerty

  • EA Guru
  • *****
  • Posts: 10393
  • Karma: +229/-178
  • I'm no guru at all
    • View Profile
Re: Tags are deleted when I remove stereotype (MDG
« Reply #11 on: August 26, 2014, 11:27:06 pm »
ROFL