Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: DavidM on March 06, 2017, 05:59:27 pm

Title: MDG connector stereo types
Post by: DavidM on March 06, 2017, 05:59:27 pm
Hello Sparx professionals
I have created a custom connector using MDG.
I would like to have the stereo type display what is in a tag value. Is there any way to do this?

e.g Tagx =  " Batch"
Connector stereotype = " <Batch> "
change Tagx to "Real time"
Connector stereotype" <Real time>"

Thanks
David
Title: Re: MDG connector stereo types
Post by: qwerty on March 06, 2017, 07:35:31 pm
So why don't you simply change the stereotype??

q.
Title: Re: MDG connector stereo types
Post by: Uffe on March 06, 2017, 08:07:54 pm
Hi David,

You could achieve this with a shape script. But in UML terms, it would be unorthodox to say the least.

If you want your models to make sense to people who know UML, do not tinker with what's displayed in «guillemets». That should be the stereotype and nothing else. What you've got is a stereotype which has a tagged value, and you want to display that value. That's not the same thing as changing the stereotype, so you shouldn't display the value in guillemets is what I'm saying.

But a shape script allows you to display tagged values as well. So attach a shape script to your connector stereotype and tell it to
Code: (Shape Script) [Select]
print("#TAG:Tagx#");
Just don't put any guillemets in there.

HTH,


/Uffe
Title: Re: MDG connector stereo types
Post by: DavidM on March 07, 2017, 07:17:49 am
Hi Guys,
Thanks for the responses.
I didn't mention that I am not using UML - this is a custom build MDG to represent our high level architecture.
I could also change the stereo type manually, I guess what I was looking at was trying to make an automatic way.

Thanks,
Gary
Title: Re: MDG connector stereo types
Post by: qwerty on March 07, 2017, 08:53:14 am
If you'd explain WHAT you basically want to achieve, people here could suggest ways to achieve it. But then we need a bit more meat.

q.
Title: Re: MDG connector stereo types
Post by: Eve on March 07, 2017, 09:15:01 am
The contents of guillemets in UML is a keyword. It just happens that by default a stereotype uses its own name as a keyword. OMG has created a precedent of the keyword being different from the stereotype.

Some types have an explicit keyword.
StandardProfileL2, which is part of UML itself uses the stereotype name with a different case. I remember some that use a shorted version of the stereotype name too.
There are also examples where a keyword is displayed based on some other property of the element.

The folllowing shape script replaces the stereotype label for a connector. I've kept the original stereotype name in, but there's no reason that's required.
Code: [Select]
shape MiddleBottomLabel
{
if(hastag("keyword"))
{
Print("#SS##stereotype#:#TAG:keyword##ES#");
}
else
{
Print("#SS##stereotype##ES#");
}
}
Title: Re: MDG connector stereo types
Post by: qwerty on March 07, 2017, 09:26:24 am
Just like <<enumeration>> isn't a stereotype but a DataType. Really strange that OMG can't fix such flaws.

q.