Author Topic: Custom element label in EA with ArchiMate  (Read 425 times)

TVereecken

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Custom element label in EA with ArchiMate
« on: September 11, 2018, 11:51:14 pm »
Hello,

I'm trying to apply a custom rendering to Archimate elements where the name of the element is in bold, the (business) domain of the element is presented below and finally the element type is put at the end.

For instance, an application component named Authenticator should be displayed as (instead of just 'Authenticator'):
Authenticator
Security
ApplicationComponent

Is there any way this behavior can be accomplished or approached in EA?

qwerty

  • EA Guru
  • *****
  • Posts: 9770
  • Karma: +179/-152
  • I'm no guru at all
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #1 on: September 12, 2018, 12:55:14 am »
The simple answer is: no.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8555
  • Karma: +209/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Custom element label in EA with ArchiMate
« Reply #2 on: September 12, 2018, 02:18:07 am »
I'm not sure that that is not possible, it depends on where it needs to get the business domain.

If you put that into a tagged value then I guess that should be possible. Getting it from the package or a related element might prove to be harder, although with the help of an add-in almost anything is possible, be it at the cost of performance.

Basically you would want to override the standard Archimate stereotype and write a shapescript that replaces the standard shapescript.
Put that into an MDG and deploy.

It not not the most simple task however. If you have never done anything like that you might want to seek help from an EA consultant.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 9770
  • Karma: +179/-152
  • I'm no guru at all
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #3 on: September 12, 2018, 05:38:56 am »
The problem is the bold face. There's nothing to set individual fonts via shape script.

q.

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6476
  • Karma: +56/-6
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #4 on: September 12, 2018, 08:58:01 am »
On a basic shape it looks something like this. (Note, the bold text for a subshape is EA 14.1 only)

Code: [Select]
shape main
{
layouttype="Border";
rectangle(0,0,100,100);

addsubshape("name","N");
addsubshape("body","CENTER");

shape name
{
bold="true";
preferredHeight=20;
h_Align="center";
print("#name#");
}
shape body
{
println("#TAG:Domain#");
println("ApplicationComponent");
}
}
Simon

support@sparxsystems.com

TVereecken

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #5 on: September 12, 2018, 05:06:31 pm »
I'm not sure that that is not possible, it depends on where it needs to get the business domain.
If you put that into a tagged value then I guess that should be possible. Getting it from the package or a related element might prove to be harder, although with the help of an add-in almost anything is possible, be it at the cost of performance.
Currently the business domain is simply included in the element name, we were thinking to move it to a tagged value.

Basically you would want to override the standard Archimate stereotype and write a shapescript that replaces the standard shapescript.
Put that into an MDG and deploy.

It not not the most simple task however. If you have never done anything like that you might want to seek help from an EA consultant.
Thanks for your suggestion. It does sounds like a non-trivial task to configure this.

We have been looking at your website - it's possible we might contact you for this (BE based).

TVereecken

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #6 on: September 12, 2018, 05:07:48 pm »
On a basic shape it looks something like this. (Note, the bold text for a subshape is EA 14.1 only)

Code: [Select]
shape main
{
layouttype="Border";
rectangle(0,0,100,100);

addsubshape("name","N");
addsubshape("body","CENTER");

shape name
{
bold="true";
preferredHeight=20;
h_Align="center";
print("#name#");
}
shape body
{
println("#TAG:Domain#");
println("ApplicationComponent");
}
}

Thank you. We'll try to get this to work.

Sunshine

  • EA User
  • **
  • Posts: 711
  • Karma: +47/-3
  • Let's just do it
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #7 on: September 12, 2018, 07:01:12 pm »
Try this shape script as it draws the ArchiMate Application Component and will do what you appear to want.

Code: [Select]
shape main
{
layouttype="border";
defsize(90,70);
rectangle(0,0,100,100);

if(hasproperty("rectanglenotation","0"))
{
addsubshape("port","w");
}
addsubshape("name","n");
addsubshape("packagename","center");
addsubshape("stereotype","s");

shape port
{
preferredwidth=20;
scalable=false;
rectangle(-10,-10,10,0);
rectangle(-10,10,10,20);
}

shape name
{
//bold="true";
preferredHeight=40;
v_align ="bottom";
h_align="center";
print("#name#");
}

shape packagename
{
preferredHeight=20;
v_align ="center";
h_align="center";
println("#packagename#"); // Assume the package is domain then could use package name
}

shape stereotype
{
preferredHeight=20;
v_align ="top";
h_align="center";
println("#stereotype#");
}

}

decoration component
{
orientation="ne";

if(hasproperty("rectanglenotation","0"))
{
}
else
{
rectangle(0,0,60,100);
rectangle(-10,10,10,30);
rectangle(-10,50,10,70);
}
}

The quick way to get the result you are looking for is to create a stereotype in your model called "ApplicationComponent" which extends UML component.

You can create stereotypes via Ribbon Configure>UML Types
Stereotype Name:ApplicationComponent
Base Class: Component
Override Appearance: Shape Script radio button
Click Edit button and paste the script
Click OK button
Click Save button
Click Close button

Once that done create a ArchiMate V3 diagram then drag a Archimate Component on to it and change the stereotype from "ArchiMate_ApplicationComponent" to "ApplicationComponent"

Hope you can follow those instructions
If you find that helpful then a helpful vote would be appreciated.
« Last Edit: September 12, 2018, 07:19:36 pm by Sunshine »
Happy to help
:)

TVereecken

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #8 on: September 12, 2018, 11:40:17 pm »
Try this shape script as it draws the ArchiMate Application Component and will do what you appear to want.

*snip*

Once that done create a ArchiMate V3 diagram then drag a Archimate Component on to it and change the stereotype from "ArchiMate_ApplicationComponent" to "ApplicationComponent"

Thank you, we'll try it out.

If you find that helpful then a helpful vote would be appreciated.

I'd like to, but I don't see that option on the thread UI.. either I'm not seeing it or I don't have enough rights as a user, which is common for new users.

qwerty

  • EA Guru
  • *****
  • Posts: 9770
  • Karma: +179/-152
  • I'm no guru at all
    • View Profile
Re: Custom element label in EA with ArchiMate
« Reply #9 on: September 13, 2018, 04:56:38 am »
It's the Helpful to the left under the poster's name.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8555
  • Karma: +209/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Custom element label in EA with ArchiMate
« Reply #10 on: September 13, 2018, 02:30:35 pm »
I'd like to, but I don't see that option on the thread UI.. either I'm not seeing it or I don't have enough rights as a user, which is common for new users.

I think you have to have at least 20 posts before you can vote.

Geert