Author Topic: Extending ArchiMate Elements (Attributes and Shapescript)  (Read 1195 times)

bkone

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
  • Is this real?
    • View Profile
Extending ArchiMate Elements (Attributes and Shapescript)
« on: October 19, 2021, 01:27:51 am »
Hello all,

I'm in the need to capture data for ArchiMate elements (e.g. Application Component: Security Rating, ...) and hence created a custom non-UML profile (generalization from ArchiMate stereotype, extension from meta class) - no MDG (yet).
Coloring was also successful (coloring the stereotype).
As I want to adhere to the naming layed out in Gerben Wierda's famous Mastering ArchiMate, I also want to show a custom name on the shapescipt.
Idea:
- use standard name attribute
- add "group" attribute
- show "
[<group>]
<name>
(<metatype>)
" on elements in diagrams.

Question would be now if I have to create a completely new shapescript (based on the one in Geerts library on github) or can overwrite only certain parts of the shapescript.
To my current knowledge I think, I have to go the first solution.


Best regards

Boris
 

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Extending ArchiMate Elements (Attributes and Shapescript)
« Reply #1 on: October 19, 2021, 02:17:51 am »
AFAIK you can not stack shape scripts as there will not be any rule in which multiple/inherited shapes are worked at. So the best would likely be (as you thought) to start from scratch.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11315
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Extending ArchiMate Elements (Attributes and Shapescript)
« Reply #2 on: October 19, 2021, 05:34:11 pm »
You can use the existing shapescript only for very basic modifications such a changing the background color, or adding a decoration.

e.g.
Code: [Select]
shape main
{
//set the fill color based on tagged value "heat map"
if(hastag("heat map","good"))
{
//light green
SetFillColor(112,255,145);
}
else if(hastag("heat map","problematic"))
{
//light yellow
SetFillColor(255,253,170);
}
else if(hastag("heat map","poor"))
{
//light red
SetFillColor(255,142,142);
}
else if(hastag("heat map","not evaluated"))
{
//white
SetFillColor(255,255,255);
}
else if(hastag("heat map","missing"))
{
//light purple
SetFillColor(227,168,255);
}
//draw the parent shape
DrawParentShape();
}
For anything more complicated you probably want to completely rewrite the shapescript.

Geert

bkone

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
  • Is this real?
    • View Profile
Re: Extending ArchiMate Elements (Attributes and Shapescript)
« Reply #3 on: October 19, 2021, 11:41:03 pm »
Hello qwerty, hello Geert,

thanks for the hints!
I managed to define shapescripts to my needs.


best regards

Boris