Book a Demo

Author Topic: MDG and inherited shapescript  (Read 4669 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
MDG and inherited shapescript
« on: March 22, 2018, 09:55:43 pm »
Hi All

Let's say I define an MDG with a stereotype named ABC which is based upon a meta class of UML::Class

I then define attributes (tagged values) and a shapescript within ABC as per usual

I now add a new stereotype XYZ, which is connected to ABC via a Generalisation connector, hence XYZ inherits from ABC

I generate the MDG, and test

Lo and behold the tagged values are inherited as expected, but alas the shapescript is not inherited

I suppose this is the intended behaviour, but just in case I have missed something, can shapescripts be inherited? If so how?

If not (as I suspect), then no option other than to copy the shapescript to all subclasses.

Thanks

Phil
Models are great!
Correct models are even greater!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG and inherited shapescript
« Reply #1 on: March 22, 2018, 11:00:45 pm »
Phil,

Have you tried using "drawParentShape()" in the shapescript of XYZ?
I think that will do what you need.

Geert

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: MDG and inherited shapescript
« Reply #2 on: March 22, 2018, 11:48:55 pm »
Thanks Geert, I will give it a try

Phil
Models are great!
Correct models are even greater!

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: MDG and inherited shapescript
« Reply #3 on: March 23, 2018, 02:54:16 pm »
If we do not overwrite the Shpaescript, it will be inherited automatically.
If you are after the same shape with only some minor differences (e.g. Color) you can also do that by just changing the default appearance of the 'Stereotype' and having (Include Color and Appearance) when saving it as a profile.

If not, you have to use DrawParentShape() (for non-UML Objects) / DrawNativeShape() (for UML Objects)