Book a Demo

Author Topic: What triggers scriptlet execution?  (Read 96704 times)

MichPaule

  • EA User
  • **
  • Posts: 70
  • Karma: +0/-0
    • View Profile
What triggers scriptlet execution?
« on: September 08, 2025, 06:40:56 pm »
EA 16.1.1629 (64bit) .QEAX database

Situation:
A diagram with elements containing scriptlets is open but hidden behind another active diagram.
Elements shown in the active diagram are modified using scripting.

Observation:
The scriptlets from the currently hidden diagram are executed and the message "Running scriptlets" pops up for every element.
If the diagram has been closed before running the script then no scriptlets are being executed (obviously).

Questions:
Why are the scriptlets being executed on this hidden diagram?
Which actions in a script trigger scriptlets execution?

Thanks in advance for any hints!

Elpis

  • EA User
  • **
  • Posts: 64
  • Karma: +7/-0
  • Make MDA/MBSE vital.
    • View Profile
Re: What triggers scriptlet execution?
« Reply #1 on: September 13, 2025, 01:19:15 am »
I'm not sure what do you mean by diagram being *hidden"...
AFAIK scriplets are launched on the diagram being open or reloaded.

MichPaule

  • EA User
  • **
  • Posts: 70
  • Karma: +0/-0
    • View Profile
Re: What triggers scriptlet execution?
« Reply #2 on: September 19, 2025, 11:59:56 pm »
I'm not sure what do you mean by diagram being *hidden"...
The diagram is opened but in the background. Another diagram hides it.
AFAIK scriplets are launched on the diagram being open or reloaded.
The diagram containing the scriptlets has been opened some time ago and it is not reloaded at this time.
It is just sitting in the background.

So the question remains: Which action triggers the scriptlets of this diagram?

MichPaule

  • EA User
  • **
  • Posts: 70
  • Karma: +0/-0
    • View Profile
Re: What triggers scriptlet execution?
« Reply #3 on: February 17, 2026, 07:08:41 pm »
So the question remains: Which action triggers the scriptlets of this diagram?
After quite a long time I had the chance to dig deeper.
Outcome:
  • Repository.RefreshModelView(pkdId)
  • Repository.AdviseElementChange(eleId)
trigger execution of all scriptlets from all open diagrams.
Regardless whether pkdId or eleId are related to the diagram content or not!  :-[

To me it seems like a bug!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: What triggers scriptlet execution?
« Reply #4 on: February 17, 2026, 08:12:00 pm »
So the question remains: Which action triggers the scriptlets of this diagram?
After quite a long time I had the chance to dig deeper.
Outcome:
  • Repository.RefreshModelView(pkdId)
  • Repository.AdviseElementChange(eleId)
trigger execution of all scriptlets from all open diagrams.
Regardless whether pkdId or eleId are related to the diagram content or not!  :-[

To me it seems like a bug!

In most cases you can replace RefreshModelView with ReloadPackage.
This is often a lot less annoying, since it doesn't reload all diagrams.

Geert

MichPaule

  • EA User
  • **
  • Posts: 70
  • Karma: +0/-0
    • View Profile
Re: What triggers scriptlet execution?
« Reply #5 on: February 17, 2026, 09:14:27 pm »
In most cases you can replace RefreshModelView with ReloadPackage.
This is often a lot less annoying, since it doesn't reload all diagrams.
Thanks Geert,
in fact I did this during bugfixing.
But sometimes it is essential to also update the opened diagrams impacted by the change.

The point is: RefreshModelView(pkgId) also triggers the scriptlets execution of diagrams otherwise completely unrelated to the change in package pkgId.