Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started 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;
- Icons are inherited; that is very good as I did not want to change those;
- The color does not get inherited but that is quickly set
- The shape script does not get inherited but I have found a way of working on copying the shape script from the original and adapt it and add it as _image in 'my' new stereotype that seems to work well.
- However the decorators seem to get inherited, I did not notice that at first but I moved the decorator of a device to a slightly different position and now I have two one on the ArchiMate3 location and one on my new location.
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.
-
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
-
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?
-
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
-
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();
}
}