Author Topic: Use Transformation script metod or standard scripting  (Read 8262 times)

steen.jensen

  • EA User
  • **
  • Posts: 161
  • Karma: +6/-1
    • View Profile
Use Transformation script metod or standard scripting
« 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??

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11712
  • Karma: +452/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Use Transformation script metod or standard scripting
« Reply #1 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

qwerty

  • EA Guru
  • *****
  • Posts: 12729
  • Karma: +361/-295
  • I'm no guru at all
    • View Profile
Re: Use Transformation script metod or standard scripting
« Reply #2 on: November 23, 2021, 03:17:38 am »
Just what Geert said.

q.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1179
  • Karma: +105/-10
  • Its the results that count
    • View Profile
Re: Use Transformation script metod or standard scripting
« Reply #3 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

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.

Happy to help
:)

steen.jensen

  • EA User
  • **
  • Posts: 161
  • Karma: +6/-1
    • View Profile
Re: Use Transformation script metod or standard scripting
« Reply #4 on: November 24, 2021, 09:56:20 am »
Thanks all of you.
Thats seems to be doable even for me  8)