Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Arnoud_B on December 14, 2021, 02:32:54 am

Title: Inheriting from an ArchiMate3 Stereotype; what is inherited and what is not.
Post by: Arnoud_B on December 14, 2021, 02:32:54 am
I did some more work on my MDG and I do not understand what gets inherited and what not if you generalise an other element. So I extend a UML root stereotype and generalize an ArchiMate3 stereotype. But I get the following behaviour;
I search the documentation but I cannot find what the generalization of another type actually does (and does not). Is that documented somewhere? I am now in trail and error mode which is not really producing results fast  :-[
I really do not want to inherit the decorator from the ArchiMate3 class or at least I want to be able to overrule its shapescript and not have two.
Title: Re: Inheriting from an ArchiMate3 Stereotype; what is inherited and what is not.
Post by: Geert Bellekens on December 14, 2021, 02:37:03 am
It should inherit all except the default color.

I've done this a couple of times, and in all cases it inherited the shapescript as well.
Seems a bit weird you are saying it doesn't inherit the shapescript, but it does inherit the decorations, while they are both defined in the same shapescript.

Geert
Title: Re: Inheriting from an ArchiMate3 Stereotype; what is inherited and what is not.
Post by: Arnoud_B on December 15, 2021, 12:41:15 am
Indeed you are right (as usual). As the image looked so different without the colloring I started to overwrite but now I changed the color and removed my overwrite it indeed looks the same ;-/
However In some cases I do want to overwrite and I would like to prevent the standard shapescript is executed (incl. the decorators). Can I inherit but prevent the parent shapescript being executed?
Title: Re: Inheriting from an ArchiMate3 Stereotype; what is inherited and what is not.
Post by: Geert Bellekens on December 15, 2021, 12:57:51 am
Indeed you are right (as usual). As the image looked so different without the colloring I started to overwrite but now I changed the color and removed my overwrite it indeed looks the same ;-/
However In some cases I do want to overwrite and I would like to prevent the standard shapescript is executed (incl. the decorators). Can I inherit but prevent the parent shapescript being executed?
Yes, by defining the shapescript yourself.

If the decorators still appear despite having overwritten the shapescript (they should not I think), I would try to create empty decorators with the same name as the original.

Geert
Title: Re: Inheriting from an ArchiMate3 Stereotype; what is inherited and what is not.
Post by: Arnoud_B on December 15, 2021, 01:55:48 am
Well that is what I did and it does not work.
I have Generalized an ArchiMate_Device and I moved the device logo created by the decoration a bit to the left (from -26 to -40) and then I have the little device twice in my element;

When I remove the drawing of a shape from the main procedure indeed the main shape is not drawn so that is indeed overruled however I still have the decoration twice.

decoration device
{
   orientation="ne";
   
   if(hasproperty("rectanglenotation","1"))
   {
      setorigin("ne",-40,10);
      moveto(15,75);
      lineto(0,100);
      lineto(100,100);
      lineto(85,75);
      startpath();
      roundrect(0,0,100,75,30,30);
      endpath();
      strokepath();
   }
}