Book a Demo

Author Topic: Best way of catching events  (Read 4571 times)

max

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Best way of catching events
« on: April 01, 2021, 08:39:20 pm »
I want to create several scripts that get triggered by certain events (EA_OnPostNewElement, EA_OnContextItemChanged etc.). Is it only possible to achieve this by using add-ins? I would prefer to use the scripts, because these I can share them directly with all my collegues. With the add-ins it is really laborious to do that, due to the needed admin privileges and that each user would have to integrate it on its own seperately (as far as I understood the process). I also looked into the workflow scripts and with these it is possible to catch some events (AllowStatusUpdate, PreAllowPhaseUpdate, AllowPhaseUpdate, CanEditStatus...). Is there a documentation on these workflow events?

To summarize it, I basically wanted to create a way to do some background checks which are triggered by events i.e. :
- that the name of a new element is not used already
- that when a status of a requirement is changed all it dependend (needed by) "child" requirements statuses are also changed accordingly

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Best way of catching events
« Reply #1 on: April 01, 2021, 08:44:00 pm »
Geert has something to offer (just in the unlikely case he might miss this one ;-). Just explore his product palette.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13496
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best way of catching events
« Reply #2 on: April 01, 2021, 08:47:18 pm »
You can either

- write your own addin
- write a Model-Addin script (Javascript only)
- Install EA-Matic and write a script in either VBScript or JScript : https://bellekens.com/ea-matic/

For checking duplicate names I already have an example: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/EA-Matic%20Scripts/PreventDuplicates.vbs

Geert

max

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Best way of catching events
« Reply #3 on: April 01, 2021, 09:14:38 pm »
Hi,

yes I already wrote my own add-in and used your example on PreventDuplicates as an template. It is all working great, I only have the issue about sharing the add-in with all my collegues. When using your toolpack EA-Matic, every user would have to install it on their own (without needing admin privileges), right?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13496
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best way of catching events
« Reply #4 on: April 01, 2021, 09:36:11 pm »
Yes, EA-Matic (or any other add-in) should be installed for every user.
The installation requires elevated rights.

Geert

max

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Best way of catching events
« Reply #5 on: April 08, 2021, 01:40:07 am »
Thanks! I will give that a try.