Author Topic: Shape script code of Archimate3 MDG shapes  (Read 9802 times)

Arnoud_B

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
    • View Profile
Shape script code of Archimate3 MDG shapes
« on: December 05, 2021, 01:43:30 am »
I am starting to create an MDG to extend the ArchiMate 3 implementation to support our specific use (mostly restrictions on the full syntax to allow for less mistakes) of ArchiMate 3.
One of the things I like to do to adapt/decorate the existing ArchiMate shapes and I searched in the forum and although I found a lot of things related I did not find an answer to my question.
If I understand correctly the Archimate3 shapes are not the best in the world and some people start completely over. I am not ready to do that (lack of time) and I am ok with the current implementation and only want to adapt a small number of things (for now).
I understand that inheritance won't work:

Code: [Select]
shape main {
    DrawParentShape();
}
decoration LetterA {
    orientation = "NE";
    print("A");
}

So I have to create my own script that will completely overwrite the existing one (not the best of OO practices but it will work).
If that is true I would like to retrieve the existing shape script code and edit it, however I do not know if I can 'steal' the current shape script code from the Archimate MDG in some way. What I figured out is that I can 'cut' the base64 code from the XML of Archimate 3 and then paste it in my stereotype but that seems a bit 'crude'.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13274
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Shape script code of Archimate3 MDG shapes
« Reply #1 on: December 05, 2021, 05:24:53 am »
You can decode the base65 encoded string quite easily. It represent a zip file containing a text file that has the shapescript.

I've done the exercise for most of the built-in MDG's: https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Shape script code of Archimate3 MDG shapes
« Reply #2 on: December 05, 2021, 06:20:43 am »
64 it is ;-)

Anyhow, there's probably still the question of copyright. Maybe some Sparxian could make a statement. I "would think" that for your own purpose you can do with the script what you want unless you sell them being based on Sparx' scripts. Just my guess...

q.

Arnoud_B

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
    • View Profile
Re: Shape script code of Archimate3 MDG shapes
« Reply #3 on: December 05, 2021, 09:53:15 pm »
Hi Geert indeed I found reference to the Github in some thread but it does not contain all Archimate 3 elements. My 'trick' in the editor with cutting and pasting the Base64 works but I though there would be a bit more structural way to do this but I'll stick to my solution then.
On the copyright remark well I'll hope in our corporate license Sparx allows us to use their elements and I am extending for the use for which we pay licence fees. I am not planning to go into commerce with this ;-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Shape script code of Archimate3 MDG shapes
« Reply #4 on: December 05, 2021, 10:01:37 pm »
base64 is easy to decrypt (if you're curious). Just stuff it in Notepad++ and use MIME tools/base64 decode. You need to select the right amount of characters! That will yield a binary zip you can store on disk and extract the utf-16 encoded file str.dat with the shape script. Though doing it the other way round is just the same you might encounter problems with coding things the way EA expects them. You would be save to create a profile from within EA using (the modified) shape scripts in _image attributes.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13274
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

Arnoud_B

  • EA User
  • **
  • Posts: 76
  • Karma: +0/-0
    • View Profile
Re: Shape script code of Archimate3 MDG shapes
« Reply #6 on: December 06, 2021, 08:05:29 pm »
Hi all, thanks for you responses. I manage to decode the base64 into readeable code and back however I though it was a bit 'flaky' as implementation but I get the feeling this is just a way to work correctly. So I'll keep doing this. However I am always afraid that I miss a much easier way of doing things in SparxEA (which is often the case) because there is somewhere a button that will do exactly what you need only I did not find it yet (there are 3000 little buttons I do not yet know). But in this case there is no nice feature except cut and paste. Not a problem I can do that  :D