Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Sorno on June 13, 2013, 05:10:42 pm

Title: Include stereotypes from other MDGs in toolbox
Post by: Sorno on June 13, 2013, 05:10:42 pm
Hi!

I'm trying to set up a MDG which extendes SysML with a few custom stereotypes. For ease of use I also would like to include a couple of stereotypes directly from SysML in my toolbox. Alas, the only way I manage to add anything to my toolbox is if I give the stereotype a new name. But since I don't do any changes in comparison to the original stereotype I would like to keep the same name, just add a button in my Toolbox.

For example, I want to include the connector "copy" to my profile "Extension". In the profile diagram I add the metatype (SysML1.3::copy), add a stereotype (copy), which generalizez the metatype.

In the toolbox profile I then add the attribut Extension::copy(SysML1.3::copy) to the stereotypes that extends the ToolBoxpage.

This work fine, IF I hadn't chosen the name "copy" on my stereotype but instead CustomCopy. But I don't want to change the name...

What else should I do to be able to just include elements and connectors from an MDG in my custom made Toolbox, without changing the name of every single one.


Hoping for your wisdom!

Edit: Rephrased the q to be more to the point...
Title: Re: Include stereotypes from other MDGs in toolbox
Post by: Filip Hendrickx on June 20, 2013, 11:28:59 pm
Hi there.

If you don't need to add things (e.g. tagged values) to the SysML connector in your toolbox, it should suffice to only add it to the toolbox, and not to the profile. That way, you simply reuse the SysML connector.

At least, that's how I got it working for elements (haven't tried connectors yet).

Filip.
Title: Re: Include stereotypes from other MDGs in toolbox
Post by: Sorno on June 20, 2013, 11:53:53 pm
Thank you for the reply!

I can confirm that your suggestion works for elements. Alas, I have no luck with connectors.

I cleaned up the profile and removed the stereotypes I want to copy. Thus, I only added attributes to the toolbox, e.g.:

SysML1.3::copy(SysML1.3::copy) = Copy (SysML)
SysML1.3::requirement(SysML1.3::requirement) = Requirement (SysML)

The element, requirement, works but not the connector. Also, in the toolbox the element and connector doesn't get a fancy icon, just an icon looking like <>. Not sure what that means, but when I got the connector working with a changed name it got its proper icon.

The only solution I still got is to create a dummy stereotype, with an different name than the original, that extend the connector's stereotype. I must be doing something wrong!

I can't find any examples of adding connectors. The only ones are of elements...  :-[


Update:
I just realized that it works differently if I import it as a UML profile instead of as a MDG. I only get the connector working when importing a profile as a UML profile. When I do a MDG the connectors don't work(EA thinks it's an element) . Thus, I do something wrong when adding a connector to a Toolbox - somehow I must mark those as connectors and not elements. But what?  (I still need to change the name of the stereotype to get it working)

I also get fancy icons (in the toolbox) when importing as a pure UML profile, and only  default icons when importing as MDG.


 

Title: Re: Include stereotypes from other MDGs in toolbox
Post by: KP on June 24, 2013, 11:00:16 am
You need to put the base class in the brackets. Try SysML1.3::Copy(UML::Dependency). (To find out what the base class is, try creating one and removing the stereotype and see what you're left with).
Title: Re: Include stereotypes from other MDGs in toolbox
Post by: Sorno on June 24, 2013, 04:56:57 pm
Thank you! That did it.