Author Topic: Modify Archimate3 MDG to display tagged values  (Read 17014 times)

NewToSparxEA

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #15 on: April 14, 2021, 09:10:42 am »
Unfortunately there isn't any way to fix that. You can't prevent the decoration from the ArchiMate shape script from being drawn and DrawNativeShape means that you get all of the native drawing.

Hi Eve, Thanks for the guidance. I believe I have found a workaround for this. I followed most of the steps in https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/redefine_ster_other_prof.html except step 1. Instead of creating a stereotype from scratch, renaming it to "Archimate::xxxx" and marking it as abstract I created a metaclass element and selected the stereotype Archimate element I am interested in. When I took this approach the abstract checkbox got selected by default. I completed all the remaining steps, included the script you provided earlier and the decoration issue was resolved. Below are the screen shots from this approach.

https://github.com/NewToSparxEA/SparxScreenShots/blob/main/showTags2.png

https://github.com/NewToSparxEA/SparxScreenShots/blob/main/alternateImage2.png
« Last Edit: April 14, 2021, 09:14:22 am by NewToSparxEA »

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1296
  • Karma: +119/-10
  • Its the results that count
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #16 on: April 14, 2021, 11:36:51 am »
Unfortunately there isn't any way to fix that. You can't prevent the decoration from the ArchiMate shape script from being drawn and DrawNativeShape means that you get all of the native drawing.
However there are two work arounds;
a) Avoid using DrawNativeShape and write the whole script that does the the shape including your mods.
b) Create you own custom MDG to do all the elements, diagrams and toolboxes

a) will be less work of course so here is my shapescript for an application component to get you started. At the time I needed to create a TIME bubble chart for applications to indicate whether we were going to Tolerate, Invest, Migrate or Eliminate applications so we needed to represent the Application as a circle. Of course now you can do the same thing in Sparx EA using custom draw style.
Code: [Select]
shape main
{
layouttype="border";
if(hasproperty("diagram.stereotype","BubbleChart"))
{
defsize(100,100);
ellipse(0,0,100,100);
addsubshape("padding","n");
addsubshape("bubblename","center");
}
else
{
defsize(90,70); //
rectangle(0,0,100,100);
addsubshape("padding","n");
if(hasproperty("rectanglenotation","0"))
{
addsubshape("port","w");
}
addsubshape("name","center");
}

shape bubblename
{
h_align="center";
println("#name#");
}

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

shape padding
{
preferredheight=15;
}

shape name
{
h_align="center";
print("#name#");
}

}

decoration component
{
orientation="ne";
if(hasproperty("diagram.stereotype", "BubbleChart"))
{
return;
}

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

decoration composite
{
orientation="SE";
if(hasproperty("diagram.stereotype", "BubbleChart"))
{
return;
}

if(hasproperty("iscomposite","true"))
{
ellipse(0,40,40,60);
ellipse(60,40,100,60);
moveto(30,50);
lineto(70,50);
}
}
Happy to help
:)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8030
  • Karma: +118/-20
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #17 on: April 14, 2021, 12:31:51 pm »
a) Avoid using DrawNativeShape and write the whole script that does the the shape including your mods.
Except that DrawNativeShape is the only way you will get the compartments, which is the whole point of this thread.

Maybe a better idea is to use your script to print specific tagged values instead of trying to get the compartment to show all of them.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1296
  • Karma: +119/-10
  • Its the results that count
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #18 on: April 14, 2021, 01:43:22 pm »
a) Avoid using DrawNativeShape and write the whole script that does the the shape including your mods.
Except that DrawNativeShape is the only way you will get the compartments, which is the whole point of this thread.

Maybe a better idea is to use your script to print specific tagged values instead of trying to get the compartment to show all of them.
Oh yeah you're right, I forgot mention not to bother with compartments in that last post. How absent minded of me, thanks Eve.
Happy to help
:)

NewToSparxEA

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #19 on: April 15, 2021, 06:47:13 am »
a) Avoid using DrawNativeShape and write the whole script that does the the shape including your mods.
Except that DrawNativeShape is the only way you will get the compartments, which is the whole point of this thread.

Maybe a better idea is to use your script to print specific tagged values instead of trying to get the compartment to show all of them.

Is there anyway to remove the angle brackets and text within << and >> in the display? In the screen shots below the text <<Archimate_Node>> and <<Archimate_Device>> are added above the element name.

https://github.com/NewToSparxEA/SparxScreenShots/blob/main/showsTags.png
https://github.com/NewToSparxEA/SparxScreenShots/blob/main/showsTags2.png
« Last Edit: April 15, 2021, 07:01:52 am by NewToSparxEA »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #20 on: April 15, 2021, 08:08:43 am »
Is there anyway to remove the angle brackets and text within << and >> in the display? In the screen shots below the text <<Archimate_Node>> and <<Archimate_Device>> are added above the element name.

https://github.com/NewToSparxEA/SparxScreenShots/blob/main/showsTags.png
https://github.com/NewToSparxEA/SparxScreenShots/blob/main/showsTags2.png



Diagram Properties > Elements > Show Element Stereotypes = OFF

It will affect all elements on the diagram.
The Sparx Team
[email protected]

NewToSparxEA

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #21 on: April 15, 2021, 11:30:29 pm »

Diagram Properties > Elements > Show Element Stereotypes = OFF

It will affect all elements on the diagram.

That is awesome - everything is working as expected now. Yay!! ;D Thank you so much KP!
Also a big thank you to Sunshine, Geert and Eve for guiding and solving this problem for me!!  :) :)

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1296
  • Karma: +119/-10
  • Its the results that count
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #22 on: April 16, 2021, 05:25:26 pm »
Glad to hear you worked it all out in the end. Have a great weekend.
Happy to help
:)

NewToSparxEA

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #23 on: July 01, 2021, 06:47:44 am »
Hi All, we recently upgraded Sparx from 15.1 to 15.2. The database repository was upgraded using the script from Sparx https://sparxsystems.com/downloads/corp/scripts/EASchema_1558_SQLServer.sql. The script was run successfully and there were no errors. The software was also upgraded and I was able to connect to the upgraded database repository. There were no issues opening and modifying any of the diagrams. However when I make changes to the MDG (which is also stored in the DB repository), publish and import the published MDG into the model the changes to the MDG are not displaying. Is there anything that needs to be upgrade the MDG from 15.1 to 15.2? Thanks in advance for your help!

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1296
  • Karma: +119/-10
  • Its the results that count
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #24 on: July 11, 2021, 07:43:42 am »
For existing elements you'll need to synchronise the stereotypes you changed. Do this by right clicking on the element in the tool box and choose synchronize stereotype. New elements should implement the change
Happy to help
:)

NewToSparxEA

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Modify Archimate3 MDG to display tagged values
« Reply #25 on: August 19, 2021, 11:30:07 pm »
For existing elements you'll need to synchronise the stereotypes you changed. Do this by right clicking on the element in the tool box and choose synchronize stereotype. New elements should implement the change
Hi Sunshine, thanks for your input but that didn't solve the issue. I did reach out to Sparx support on this issue and they helped identify the problem. In the steps to create the MDG technology a fully qualified path for the .mts file and .xml file is required. When I provided the fully qualified path I was able to complete the steps without any issues.