Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: steverumsby on September 07, 2022, 06:46:03 pm

Title: Can you use !INC in a scriptlet?
Post by: steverumsby on September 07, 2022, 06:46:03 pm
I have some diagram scripts (Javascript) that work quite nicely and (now) quickly enough that I thought it would be useful to convert them to scriptlets (EA 16). However, when I do that I get errors on the !INC lines of my code. Is it not possible to include library files into a scriplet? If true, that makes them a whole lot less useful. Or am I doing something wrong?

Steve.
Title: Re: Can you use !INC in a scriptlet?
Post by: steverumsby on September 12, 2022, 07:13:21 pm
Reply from Sparx support - no you can't, but we'll record it as a feature request for future consideration.

Just in case anybody else trips over this...

Steve.
Title: Re: Can you use !INC in a scriptlet?
Post by: JoNijsen on February 06, 2024, 10:25:54 pm
In 16.1.1628 !INC can be used in scriptlets but I found that the scriptlet is not stopped at the end of the script, which causes an error the subsequent times the scriptlet is run
Title: Re: Can you use !INC in a scriptlet?
Post by: Geert Bellekens on February 06, 2024, 10:34:48 pm
In 16.1.1628 !INC can be used in scriptlets but I found that the scriptlet is not stopped at the end of the script, which causes an error the subsequent times the scriptlet is run
what do you mean by "is not stopped at the end of the script"?

Geert
Title: Re: Can you use !INC in a scriptlet?
Post by: steverumsby on February 15, 2024, 09:29:16 pm
In 16.1.1628 !INC can be used in scriptlets but I found that the scriptlet is not stopped at the end of the script, which causes an error the subsequent times the scriptlet is run
I've been using !INC in scriptlets since it became possible and I've never noticed this problem. What do you mean by "the scriptlet is not stopped"? What are the symptoms?
Title: Re: Can you use !INC in a scriptlet?
Post by: JoNijsen on April 22, 2024, 02:59:18 am
In the context menu of the scriplet the run option is no longer enabled.
And the second time I run it (manually or reload diagram ) it crashes EA, sometimes EA closes completely
Title: Re: Can you use !INC in a scriptlet?
Post by: MichPaule on July 11, 2024, 12:08:52 am
In 16.1.1628 !INC can be used in scriptlets but I found that the scriptlet is not stopped at the end of the script, which causes an error the subsequent times the scriptlet is run
I can confirm that the script in the scriptlet is not stopped properly.
This is unrelated to !INC as I don't have that in my script.
After opening a diagram the script executed and the "Stop Script" context menu command remains active.
When clicked it stops the script and gets disabled (grayed).
If I click "Run Scriptlets" before stopping the script manually I'm getting an error like e.g. "redeclaration of let " which is to be expected in case of a still running script.
Looks the scriptlets feature needs some rework  :-[
Title: Re: Can you use !INC in a scriptlet?
Post by: MichPaule on July 19, 2024, 03:59:51 pm
Just FYI:
Bug report is out (#24077893)
Let's see what they have to say...
Title: Re: Can you use !INC in a scriptlet?
Post by: MichPaule on September 12, 2024, 03:38:36 pm
Just FYI:
Bug report is out (#24077893)
Let's see what they have to say...
Update:
The issue has been confirmed and will be investigated further by our development team.
 ;)
Title: Re: Can you use !INC in a scriptlet?
Post by: JoNijsen on December 02, 2024, 09:49:02 pm
In 16.1.1628 !INC can be used in scriptlets but I found that the scriptlet is not stopped at the end of the script, which causes an error the subsequent times the scriptlet is run
what do you mean by "is not stopped at the end of the script"?

Geert

I mean that EA thinks the script is still running