How to run script from diagram?

295 views
Skip to first unread message

survex

unread,
Nov 23, 2014, 4:56:01 AM11/23/14
to sparx-enterprise-archite...@googlegroups.com
I've made some automation scripts and I want to execute them from diagram. We can add hyperlink element to diagram of type EACommand and set some commands to hyperlink. I'm looking for the ability to execute script from diagram same way. Is it possible?

[original message]

qwerty

unread,
Nov 23, 2014, 9:06:47 AM11/23/14
to sparx-enterprise-archite...@googlegroups.com
Drag the scripting editor window from its tab to some other position (an eventually dock it elsewhere). From there you can run the script with a diagram open.

Also you can issue Run Script from the context of the script in the Scripting window.

q.

[original message]

survex

unread,
Nov 23, 2014, 10:46:41 AM11/23/14
to sparx-enterprise-archite...@googlegroups.com
I think I haven't made my question clear.

I can make working panel on my diagram using:
- Report Specification Artifact
- Hyperlink type: EACommand , GenerateWSDL
etc.

So my diagram is set of "buttons" executing specific tasks.

I want to create "button" which executes some script - I don't want to open Scripting window and stuff like that.

[original message]

qwerty

unread,
Nov 23, 2014, 12:45:08 PM11/23/14
to sparx-enterprise-archite...@googlegroups.com
I guess you can't do that. Hyperlink looks like it would be the place to offer such a functionality as there it has bells and whistles for everything - except running a script or calling an add-in. The latter hasn't even made it into the menu bar...

q.

[original message]

survex

unread,
Nov 23, 2014, 2:05:56 PM11/23/14
to sparx-enterprise-archite...@googlegroups.com
Hm, maybe I will use some dirty hack:
- say I have script [Foo] to execute for current model
- I create proxy diagram script [FooDiagram] for script [Foo]
- I add any diagram hyperlink on my panel (i.e. diagram with "buttons") naming it Foo
- and if I want to run script Foo: Right Click on hyperlink Foo > Script > Foo

Very clumsy I guess, but for me it would be better to have predefined set of actions with comments in one place, then to change window, to search needed script for current model and trying to remember what it is doing.

[original message]

qwerty

unread,
Nov 23, 2014, 3:25:40 PM11/23/14
to sparx-enterprise-archite...@googlegroups.com
You might subscribe an add-in for EA_OnContextItemChanged and see if one of your buttons got clicked.

q.

[original message]

Bellekens@localhost Geert Bellekens

unread,
Nov 24, 2014, 2:56:36 AM11/24/14
to sparx-enterprise-archite...@googlegroups.com
I'm working on an add-in to allow scripts to be triggered when EA events happen:
EA Scripting Addin (https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/tree/master/EAScriptAddin)

Would you be interested in something like that?

Geert

[original message]

survex

unread,
Nov 24, 2014, 6:36:15 AM11/24/14
to sparx-enterprise-archite...@googlegroups.com
Sure, it would be very convenient!

[original message]

Bolleininger@localhost Stefan Bolleininger

unread,
Nov 24, 2014, 6:46:24 AM11/24/14
to sparx-enterprise-archite...@googlegroups.com
Hi,

I did some work on the event-based scripting last user group meeting last october.
Maybe you may take the presentation sheets from there.

Regards

Stefan

[original message]

Bellekens@localhost Geert Bellekens

unread,
Nov 24, 2014, 7:06:46 AM11/24/14
to sparx-enterprise-archite...@googlegroups.com

3A3C3B3F2C31490 wrote:
[quote author=092B2B3C3A600C2B22222B252B203D4E0 link=1416735875/0#6 date=1416814960]I'm working on an add-in to allow scripts to be triggered when EA events happen:

EA Scripting Addin (https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/tree/master/EAScriptAddin)

Would you be interested in something like that?


Sure, it would be very convenient!
[/quote]
I'll post here when I have released the first beta version. I'm hoping to release it in the next couple weeks.

Geert

[original message]

Bellekens@localhost Geert Bellekens

unread,
Nov 28, 2014, 3:05:39 AM11/28/14
to sparx-enterprise-archite...@googlegroups.com
I've just released the first beta version of the add-in.

EAScriptAddin_Setup_v1.0.2.1(BETA).msi (https://googledrive.com/host/0B5YX31GyMA64WmJET1pXRmxnVDA/EAScriptAddin_Setup_v1.0.2.1(BETA).msi)

Best to start by creating a new empty script and then start the settings dialog using Extensions|Scripting Addin|Settings

Use the checkbox "Show all operations" to show all possible operations, select the operation and the script and press "add function"

Then you can close the dialog, press the button "refresh script tree" in the scripting window, and start adding functionality.

The operation will be triggered just like it would in a "real" add-in.

Geert

PS. Thanks to Stefan Bolleininger for the initial code and the idea.

[original message]

Bellekens@localhost Geert Bellekens

unread,
Dec 4, 2014, 2:45:42 AM12/4/14
to sparx-enterprise-archite...@googlegroups.com
I've published a newer beta version
EAScriptAddin_Setup_v1.0.3.0(BETA).msi (https://googledrive.com/host/0B5YX31GyMA64WmJET1pXRmxnVDA/EAScriptAddin_Setup_v1.0.3.0(BETA).msi)
This version supports the "!INC" syntax to include local scripts, and makes it easier to add a new script function (doubleclick or check the checkbox)

Geert

[original message]
Reply all
Reply to author
Forward
0 new messages