Book a Demo

Author Topic: MDG connector stereo types  (Read 5459 times)

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
MDG connector stereo types
« 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
« Last Edit: March 06, 2017, 06:13:49 pm by DavidM »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG connector stereo types
« Reply #1 on: March 06, 2017, 07:35:31 pm »
So why don't you simply change the stereotype??

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: MDG connector stereo types
« Reply #2 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
My theories are always correct, just apply them to the right reality.

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: MDG connector stereo types
« Reply #3 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG connector stereo types
« Reply #4 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.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDG connector stereo types
« Reply #5 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#");
}
}
« Last Edit: March 07, 2017, 04:01:53 pm by Simon M »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG connector stereo types
« Reply #6 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.