Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: yonatan.lehman on May 30, 2022, 05:23:12 am
-
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
-
How is that interface stereotype defined in your MDG?
q.
-
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