I have asked this question in a different treat before but all suggestions given did not help me resolve the issue.
As SparxEA is not very verbose (it does not give you any feedback why things do not work ;-/ ) it is hard to say it I do it wrong or if SparxEA just works differently. So I will try to document my case a bit better and I hope somebody will spot the error.
So what do I do?
I am building a ArchiMate MDG with some specific extensions of standard ArchiMate element that will contain extra attributes and which I can validate with scripts (as different rules apply to different sub types)
In my POC I create an extension of ArchiMate_Device --> ArchiStib_StandardHardware
It 'generalizes' the ArchiMate element and it 'Extends' the UML metaclass. I think I now do that correctly.
https://imgur.com/a/t6MHO3PI add a shape script (code below) to overwrite the image;
- it makes it a simple rectangle
- it adds a SBB decorator on top in the middle
- it overwrites the decorators device and composite
Well at least I try! overwriting the image with a rectangle works, the extra decorator is there however I have the device and composite decorators twice. Once from this class once from its parent.
(a sniplet of the result is in above image URL)
On the metaclass there is an attribute _HideMetaclassIcon however I do not think there is such an attribute for a stereotype object.
I tried all kinds of things but it is trail and error and it gets me nowhere ...
Any help is highly appreciated.
The typescript code I use:
shape main
{
layouttype="border";
noshadow=true;
defsize(90,70);
//if(hasproperty("rectanglenotation","1")) only rectangle notation is supported
rectangle(0,0,100,100);
addsubshape("rect_padding","n");
addsubshape("name","center");
shape rect_padding
{
preferredheight=20;
}
shape name
{
bold=true;
v_align="top";
h_align="center";
print("#name#");
}
}
decoration device // same icon but on a different place
{
orientation="ne";
moveto(15,75);
lineto(0,100);
lineto(100,100);
lineto(85,75);
startpath();
roundrect(0,0,100,75,30,30);
endpath();
strokepath();
}
decoration SBB // new 'icon'
{
orientation="n";
print("SBB");
}
decoration composite // same icon but on a different place
{
orientation="se";
if(hasproperty("iscomposite","true"))
{
ellipse(0,40,40,60);
ellipse(60,40,100,60);
moveto(30,50);
lineto(70,50);
}
}