Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: steen.jensen on November 23, 2021, 12:04:49 am

Title: Use Transformation script metod or standard scripting
Post by: steen.jensen on November 23, 2021, 12:04:49 am
Have some users using an propritary notation "Prime Arch" that is as Archimate om Steriods :o.
Now they have some issues and we Wonder how to simply transform those models  to UML and/or Archimate.
By Transformation script or  standard scripting (JavaScript).
Whats easiest method??
Title: Re: Use Transformation script metod or standard scripting
Post by: Geert Bellekens on November 23, 2021, 12:18:52 am
Definitely easier using a standard script.

The transformation template syntax is euh, lets say "headache-inducing" :-X

Geert
Title: Re: Use Transformation script metod or standard scripting
Post by: qwerty on November 23, 2021, 03:17:38 am
Just what Geert said.

q.
Title: Re: Use Transformation script metod or standard scripting
Post by: Sunshine on November 23, 2021, 07:57:35 am
It really depends on your skilllset. Assuming you have your model already in Sparx EA then script is probably the easiest if you have experience programming in jscript/javascript.

Do you want to transform (keep the original and create another set of element types) or Convert (change the original elements to a new set like Archimate).

I have shared JScript to convert objects and stereotypes of elements from one modelling language to another in the forum a few times. This post was the last time I share the script but with just one element type to convert. If you do a search through my posts you'll find similar code but with more elements to convert.
This might help you kick off what you need.
https://www.sparxsystems.com/forums/smf/index.php/topic,45674.msg267977.html#msg267977 (https://www.sparxsystems.com/forums/smf/index.php/topic,45674.msg267977.html#msg267977)

To change a number of elements types and stereotypes just add entries to the TypeConversion[] array at the top to the code

Code: [Select]
// Array of types and stereotypes to convert: Source Type, Source Stereotype, Target Type, Target Stereotype
Conversions[0] = new TypeConversion("Class", "Standard", "Class", "Archimate::Standard");
Conversions[1] = new TypeConversion("Class", "Requirement", "Class", "Archimate::Requirement");
Conversions[2] = new TypeConversion("Component", "", "Component", "Archimate::Component");
...
If you wanted to convert relationships as well then need to add that code.

If however programming jscript skills aren't in your skill set then an alternative which is a bit of a hack.
Open an eap file with MS Access and do a search and replace in t_object and t_connection tables to convert or write SQL script.

Title: Re: Use Transformation script metod or standard scripting
Post by: steen.jensen on November 24, 2021, 09:56:20 am
Thanks all of you.
Thats seems to be doable even for me  8)