Sparx Systems Forum
Enterprise Architect => General Board => Topic started 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
-
So why don't you simply change the stereotype??
q.
-
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 print("#TAG:Tagx#");
Just don't put any guillemets in there.
HTH,
/Uffe
-
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
-
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.
-
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.
shape MiddleBottomLabel
{
if(hastag("keyword"))
{
Print("#SS##stereotype#:#TAG:keyword##ES#");
}
else
{
Print("#SS##stereotype##ES#");
}
}
-
Just like <<enumeration>> isn't a stereotype but a DataType. Really strange that OMG can't fix such flaws.
q.