Author Topic: viewing only the simple stereotype name in a component diagram  (Read 1854 times)

yonatan.lehman

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
I am writing a Jscript (EA14) to set the stereotype of Activities.
The stereotype is called interface and its defined by the fully qualified MyCompany::interface
My problem is that in the component diagram I only want to see <interface> (without the qualifier) but I've tried various combination of assigning a value to activity.StereotypeEx, activity.Stereotype and both of them.  I tried assigning Stereotype before and after StereotypeEx and of course I always did activity.Update() and Refesh() at then end

1) If I assign only activity.StereotypeEx - then I get <MyCompany:interface>
2) If I assign only activity.Stereotype - then I get <interface> - but not the one I want (it's using some other default)
3) If I assign both activity.StereotypeEx and activity.Stereotype then I get both names <inteface,MyCompany::interface>)

I do the same thing with a sterotype called <internal> - this works as expected and shows only the simple name, I guess because it does not clash with anything else.

I tried to use Start>Perspective>Customize List of Available Perspectives> to disable almost everything else apart from bare UML and MyCompany - but that didn't help.

What do I need to do - either in the Script - or in the UI so that the diagram will only show the simple stereotype name and that it will behave as defined by the fully qualified stereotype name ?

Thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: viewing only the simple stereotype name in a component diagram
« Reply #1 on: May 30, 2022, 07:16:28 am »
How is that interface stereotype defined in your MDG?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: viewing only the simple stereotype name in a component diagram
« Reply #2 on: May 30, 2022, 01:57:27 pm »
1) If I assign only activity.StereotypeEx - then I get <MyCompany:interface>
You should use MyCompany::interface, with the double colons.

A best practice that I've adopted is to prefix you stereotype names. So I would probably make the stereotype «MC_interface»

That way there cannot be name conflicts, and EA will never assign the wrong stereotype.

Geert