Book a Demo

Author Topic: Run script at element creation?  (Read 3146 times)

EAabecedarian

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Run script at element creation?
« on: February 07, 2022, 11:24:19 pm »
I'm setting up an MDG which, for instance, provides an element "Software Component" based on "Component" metaclass.
Generating and using that MDG works fine so far.
Now I'd like to create several packages and diagrams to add more details on each software component (e.g. Structural and Sequence diagrams).
I can write a script for this, select each Software Component and run it manually - would work, but is time consuming.

Is there a way to trigger that script once each time a new "Software Component" is created?
And if so, can it be integrated in the MDG?

BR,

EAabecedarian

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Run script at element creation?
« Reply #1 on: February 07, 2022, 11:49:06 pm »
You can write an add-in. Also IIRC there's some new scripting feature within EA that allows to catch triggers for On_New etc. events.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Run script at element creation?
« Reply #2 on: February 08, 2022, 12:18:02 am »
q was referencing the new Model-addin feature: https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/modeladdins.html

You can also use my free EA-Matic add-in to do the same with "regular" scripts: https://bellekens.com/ea-matic/

Geert

EAabecedarian

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Run script at element creation?
« Reply #3 on: February 08, 2022, 05:23:28 pm »
Thank you both! I'll have a look... :-)