Author Topic: Model based add-ins - reloading  (Read 1019 times)

Stanislav Hrabí

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Model based add-ins - reloading
« on: July 11, 2019, 09:39:26 pm »
Hello, fellow EA users and/or developers :-)

I`ve been trying out the new EA's 15 feature - Model based add-ins

The only manual I`ve found so far is this one: https://community.sparxsystems.com/white-papers/1277-enterprise-architect-15-model-based-javascript-addin and latest api`s: https://www.sparxsystems.com/enterprise_architect_user_guide/15.0/automation/repository3.html

I`m quite adept with EA's scripting and somewhat familiar with normal add-ins. I`ve managed to modify the functionality in the example model.

Now, to the issue itself: unlike the scripting, I can`t simply save a version of my add-in and run it/see the results. It seems like I have to reload it first. I found out I don`t have to reload EA/model - I can reload the add-in by unchecking and subsequent checking of the Load on Startup checkbox in Manage Add-Ins. Nevertheless, that still seems a little bit tedious. Maybe there is a quicker way - like a button right “under the nose”, I fail to see :-) … 

Looking forward to hearing any advice/input... ;-)

« Last Edit: July 11, 2019, 10:05:21 pm by Stanislav Hrabí »

qwerty

  • EA Guru
  • *****
  • Posts: 10497
  • Karma: +231/-190
  • I'm no guru at all
    • View Profile
Re: Model based add-ins - reloading
« Reply #1 on: July 11, 2019, 11:14:19 pm »
Not sure about 15 (and 14) but ever since it has been that way. :-/

q.

Stanislav Hrabí

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Model based add-ins - reloading
« Reply #2 on: July 12, 2019, 01:36:00 am »
Hi, qwerty :-)

Thank you for your reply. However, I must admit I’m not sure If we understand each other (and if I made myself clear).

The functionality I write about is creation of Model Based add-ins (the first link in the previous post). I believe it has been added in the EA 15, which is still in RC status. Version EA 14 and older could only use “standard” add-ins, which use .dll COM files.

When I try to change something in a standard add-in (available in EA14 and older), I think I have to close EA, then compile the code to create a new version of .dll and then start EA again (usually in debug mode). I don’t know how to update a standard add-in without closing EA altogether, because the compiler won’t let me update a file that is being used (“used by another process” error).

The Model Based add-ins allow me to edit code while running EA and even update the plugin without closing EA. I just have to disable and re-enable the add-in. What I’d like to know if there is even faster way to propagate a change in a model based add-in. Specifically it would be nice to have something like a save+update add-in option in the behavior editor.

If you know a way, how to update a standard add-in without closing EA first, please let me know - it would be a great help  :). And if you know how to update a model based add-in more easily than by steps: save, Manage add-ins -> uncheck Load on startup, Manage add-ins -> check Load on startup, it would be even better  :)

S.

qwerty

  • EA Guru
  • *****
  • Posts: 10497
  • Karma: +231/-190
  • I'm no guru at all
    • View Profile
Re: Model based add-ins - reloading
« Reply #3 on: July 12, 2019, 02:56:57 am »
Ah, if there's something new in V15 that did not get me. I switched from being an early adopter to a "wait for the gambler finish the next two versions". So expect me to catch up with V15 when V17 comes out.

It's about holiday time here in the northern hemisphere. So the usual suspects might be out for vacation. You could send a feature request to Sparx using the link below in the support section. But the times when we had a solution the next week after asking for it here ls dated back more than 10 years or so.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6781
  • Karma: +63/-6
    • View Profile
Re: Model based add-ins - reloading
« Reply #4 on: July 12, 2019, 09:20:01 am »
There's not currently a better way than disabling/enabling the add-in.

The running add-in has state, which makes it a little more difficult to run a change on the fly than a normal script (but much easier than a traditional add-in)

It's on my personal wish list that when editing the behavior view of an add-in it could dynamically update the function definition.
« Last Edit: July 12, 2019, 09:53:59 am by Eve »
Eve

support@sparxsystems.com

Stanislav Hrabí

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Model based add-ins - reloading
« Reply #5 on: July 19, 2019, 10:54:18 pm »
Thanks for the replies.

I believe the solution could be quite simple. Just add a button to behavior editor, which would: save code, disable edited add-in and then re-enable it. Maybe one could make the button visible only when editing an element with the JavaScriptAddin stereotype...

Anyways - I believe it should/could take minutes to make (admittedly more time to test), but it would help (me and other users) A LOT :-)

I've posted this as priority request for a feature. I really hope the developers will make this happen... :-)