Author Topic: Best way to use EA-Matic for larger Scripts  (Read 2014 times)

bkone

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
  • Is this real?
    • View Profile
Best way to use EA-Matic for larger Scripts
« on: July 06, 2020, 06:51:34 pm »
Hello all,

I tried to find some information in the forum on the mentioned topic, but I wasn't successfull.
If this topic was discussed before, just point me to the messages/threads.

I will create in the next future extensive scripts to handle ArchiMate modelling. Unfortunately EA support modelling, but falls short on analysis features. Hence, I have to create them ...
I played a bit with EA-Matic as I like the scripts approach more that going full in on DLL development.
Currently I have the following questions marks above my head:

- Why is EA-Matic complaining (not seeing the scripts) if I start using typed variables instead of just object?
For example: dim element as EA.Element
This would be helpful to use the suggestions in the editor.

- Only one script to handle the menu?
I tried to have multiple scripts contributing to the menu, but only the last script wins (has it's menu displayed).
So it seems as if I can only use one scripts to handle the menu for all scripts with functionality (and call them from the menu-script).
Is this correct?


Best regards

Boris

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7718
  • Karma: +101/-18
    • View Profile
Re: Best way to use EA-Matic for larger Scripts
« Reply #1 on: July 07, 2020, 08:34:12 am »
- Why is EA-Matic complaining (not seeing the scripts) if I start using typed variables instead of just object?
For example: dim element as EA.Element
This would be helpful to use the suggestions in the editor.
As I understand it, because that's not actually part of the language and EA-Matic is passing the scripts directly through to the windows interpreter.
Eve

support@sparxsystems.com

bkone

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
  • Is this real?
    • View Profile
Re: Best way to use EA-Matic for larger Scripts
« Reply #2 on: July 08, 2020, 04:50:38 pm »
That seem's to be the case.
I will go without typed variables.

Another issue seems to be using includes with EA-Matic.
Any sub/function from an included script doesn't seem to be available as I get errors like "... Variable is not defined: <function name> ...".
In scripts without EA-Matic it works.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11823
  • Karma: +458/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best way to use EA-Matic for larger Scripts
« Reply #3 on: July 11, 2020, 05:08:33 pm »
You have to include "EA-Matic" in the included scripts as well. Otherwise EA-Matic doesn't see those.

for the other issues
- Yes you cannot use "as xxx" as this is not valid VBScript syntax. EA uses that for the autocomplete, but probably strips those before actually processing the scripts as well.
- Yes, there is only one menu function you can use, that is how the EA add-in systems works. An add-in (EA-Matic in this case) only gets one menu.


Geert