Author Topic: Transition from VBScript to EA's JavaScript  (Read 2176 times)

David Rains (bioform)

  • EA User
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Transition from VBScript to EA's JavaScript
« on: January 26, 2019, 03:41:22 am »
From EA's automation help ... Sparx Systems now recommends creating any new scripts in JavaScript. Our JavaScript implementation is based on the Mozilla Spidermonkey implementation... The advantage of using JavaScript is that it is wholly built and distributed by Sparx Systems, meaning we are able to actively support both the execution and debugging of scripts into the future.

My question - I am finally getting back to using EA again at work and supporting some automation/customizations... also I am learning Python so I can make use of some NLP toolkits in my requirements engineering work... So jumping to JavaScript.... what "source" should I be looking for to try to match my learning to EA's implementation? Am I going to run into issues.... e.g., ScriptLib examples are in JScript(?)  vs. what they are calling JavaScript correct?  I just need a little advice to make sure I get started on the right foot...

Any links, etc. appreciated...

qwerty

  • EA Guru
  • *****
  • Posts: 12734
  • Karma: +361/-295
  • I'm no guru at all
    • View Profile
Re: Transition from VBScript to EA's JavaScript
« Reply #1 on: January 26, 2019, 04:07:17 am »
I alway stayed away from EA's internal "goodies", be it scripting, transformation or all sorts of generation and just used my favorite language externally with tools I know that work, have debugging and so on. For Python I use WingPersonal.

q.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1180
  • Karma: +105/-10
  • Its the results that count
    • View Profile
Re: Transition from VBScript to EA's JavaScript
« Reply #2 on: January 26, 2019, 09:30:44 am »
Yes I saw that recommendation to use JavaScript from Sparx Systems, shame they haven't backed that up with examples and an update to the JavaScript Engine. The JavaScript Engine in Sparx EA is a little old now however still functional. So if you looking for general JavaScript tutorials then be aware it won't support all the latest features.
I use JScript as most of the examples are in JScript which is Microsoft's version of JavaScript with extensions for activeX components. Its close enough to JavaScript that it will be relatively easy to update when better support for JavaScript is available.
For programming with the Sparx EA API see https://www.sparxsystems.com/resources/user-guides/14.0/index.html#automation
Happy to help
:)

David Rains (bioform)

  • EA User
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Re: Transition from VBScript to EA's JavaScript
« Reply #3 on: January 26, 2019, 09:56:38 am »
Okay, so I am hearing that their recommendation might not really be worth worrying about right now? (engine not up to date, etc.)  I will take that to heart... Since I am learning Python, it would be nice to start migrating from VBScript... so finding a way to leverage my training from python into a related lanaguage seems like a good idea...

Querty, you mentioned a Python environment you like using... (I am currently learning with Sublime and Jupyter Notebooks, so now is a good time to get introduced to an IDE that might help me move forward - Wing from WingWare will take a look at that!)

What about the Hybrid Scripting document from Sparx? That looked interesting... but is it restricted to MS NET languages... (integration with VS) in 14.1 I see as in the example Java, C#, and C++... it is possible to work with other languages? If so HOW would I give them visibility within that Model Wizard | Application Patterns window... is this a 'feature' from Sparx or a series of configuration settings?

« Last Edit: January 26, 2019, 10:33:31 am by David Rains »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11723
  • Karma: +454/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Transition from VBScript to EA's JavaScript
« Reply #4 on: January 26, 2019, 04:37:12 pm »
Hi David,

I have a ton of VBScript scripts and I don't really see a reason why I would change.
After all, it's just a different syntax, otherwise both languages are pretty comparable.

Added advantage for VBScript is that you can translate it to VBA in Office products real easy.

Geert