Author Topic: How can I remove stereotypes?  (Read 2452 times)

Steve Wartik

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
  • Why aren't I outside?
    • View Profile
How can I remove stereotypes?
« on: April 10, 2008, 09:39:53 pm »
I have a model in which I have assigned multiple stereotypes to certain classes. I'm having several problems with them. First of all, they often show up multiple times in diagrams. In other words, I have stereotypes "subcls" and "supercls" assigned to one of my classes, and in a diagram it displays as <<supercls,subcls,supercls>>.

Furthermore, I can't remove the stereotypes. If I click the "..." box next to the stereotype menu and de-select stereotypes, it has no effect -- when I click OK, the stereotypes are selected again when I return to that pop-up. Similarly, when I clear the stereotype menu and click OK, the stereotype reappears when I return to the properties pop-up.

Any suggestions? I'm willing to edit an exported XMI file if that's what it takes!

Thanks,

Steve

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How can I remove stereotypes?
« Reply #1 on: April 10, 2008, 10:09:12 pm »
Hi Steve,

First, if you can do so, please compress your project and attach it to a bug report to Sparx. They need to address this.

You'll find the appropriate form by clicking the Registered Users link at the top of any forum page. The bug report link is near the top.

In the interim you can use the Elements tab of the diagram Properties dialog to clear the Show Element Stereotypes option. This is pretty strong medicine, but it might give you a break while you wait for a better resolution.

Have you played with the drop-down on the Stereotypes dialog? Perhaps you have a duplicate someplace.

Another possibility... Try clearing the stereotype in the Element Properties text box, or setting it to a well-known 'dummy' setting. See if you can delete the others now. If so, reconstruct the set using the Stereotypes dialog only. Any difference?

David
No, you can't have it!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How can I remove stereotypes?
« Reply #2 on: April 10, 2008, 10:11:18 pm »
While I'm thinking about this...

Ensure that the additional stereotypes you've used are present in the Stereotypes tab of the Settings | UML dialog, and that the base class list contains your element type. If not, add them to this dialog, then see if you can delete them from your classes.

David
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How can I remove stereotypes?
« Reply #4 on: April 11, 2008, 02:47:24 am »
Don't it though.

Perhaps this time it'll get solved.

We live in hope.
No, you can't have it!

Steve Wartik

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
  • Why aren't I outside?
    • View Profile
Re: How can I remove stereotypes?
« Reply #5 on: April 11, 2008, 04:27:43 pm »
Thanks to all for suggestions. The most useful one, unfortunately, is to file a bug report... I'll post another reply on this thread when I hear anything.

Steve

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2572
  • Karma: +36/-2
    • View Profile
Re: How can I remove stereotypes?
« Reply #6 on: April 11, 2008, 04:45:55 pm »
Quote
I have a model in which I have assigned multiple stereotypes to certain classes. I'm having several problems with them. First of all, they often show up multiple times in diagrams. In other words, I have stereotypes "subcls" and "supercls" assigned to one of my classes, and in a diagram it displays as <<supercls,subcls,supercls>>.
I've seen this kind of thing before when the model had stereotypes with a ',' in the stereotype name, but that was a long time ago (the model was created in the days before EA allowed multiple stereotypes). Go to Settings > UML and make sure there are no stereotypes with ',' and if there are delete them. Also look in any profiles and technologies you have loaded. I suspect this isn't the answer, but it needs eliminating.
The Sparx Team
support@sparxsystems.com

Steve Wartik

  • EA User
  • **
  • Posts: 38
  • Karma: +0/-0
  • Why aren't I outside?
    • View Profile
Re: How can I remove stereotypes?
« Reply #7 on: April 11, 2008, 04:54:53 pm »
Quote
I've seen this kind of thing before when the model had stereotypes with a ',' in the stereotype name, but that was a long time ago (the model was created in the days before EA allowed multiple stereotypes). Go to Settings > UML and make sure there are no stereotypes with ',' and if there are delete them. Also look in any profiles and technologies you have loaded. I suspect this isn't the answer, but it needs eliminating.
I checked and, regrettably, you're right about commas not being the answer. I've filed a bug report, so we'll see what those with access to EA source code have to say.

Steve

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2572
  • Karma: +36/-2
    • View Profile
Re: How can I remove stereotypes?
« Reply #8 on: April 14, 2008, 11:27:24 am »
Quote
I've filed a bug report, so we'll see what those with access to EA source code have to say.
That'll be me. I've had a look at your model, and my hunch was correct that it was caused by stereotypes with commas in their name. I've sent you an e-mail with instructions on how to fix it, but for anyone else who finds this thread I'll post it here too...

Quote
Export your model to XMI and open it in a text editor. Search for "supercls,subcls" and you will find a number of lines with stereotype definition blocks like this:

@STEREO;Name=supercls,subcls;GUID={DBF57B9C-1B96-4dd1-B7C9-28C3319C3893};@ENDSTEREO;

Edit the name in each case (I just did a global find-and-replace to change "supercls,subcls" to "subcls" and it seemed to work OK, but you might like to be a bit more careful - some may need to be changed to "supercls" and some may need to be removed entirely) then save the XMI and re-import it into your model. Don't tick the "Strip GUIDs" checkbox in order for the XMI to update the existing model with the corrected stereotypes.
HTH,

Neil
The Sparx Team
support@sparxsystems.com