Book a Demo

Author Topic: Notification When an Element is Modified  (Read 5072 times)

SteveC

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Notification When an Element is Modified
« on: September 11, 2018, 07:32:14 am »
Is anyone aware of how an add-in can be notified when an element is modified?

For example, I'd like to know when the user changes a tagged value of one of the elements. This would allow the add-in to check if it should perform any processing on the element based on the new tagged values.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Notification When an Element is Modified
« Reply #1 on: September 11, 2018, 07:45:04 am »
There's a hook (EAOnContextItemChanges IIRC out of memory). But it does not report TV changes.

q.

EXploringEA

  • EA User
  • **
  • Posts: 172
  • Karma: +8/-0
    • View Profile
Re: Notification When an Element is Modified
« Reply #2 on: September 11, 2018, 04:49:49 pm »
I had this requirement sometime ago and used EA_OnNotifyContextItemModified but this doesn't let you know if this is due to a tagged value change. 

Hence, my approach was to use EA_OnContextItemChanged to track the selection of an element, and take a copy of tagged values before any changes.  Then when ContextItemModified is triggered a check can be made to see if there is any difference for a tagged value.  Not ideal.. 

EXploringEA - information, utilities and addins

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Notification When an Element is Modified
« Reply #3 on: September 11, 2018, 04:53:27 pm »
There is a (fairly) new set of events related to editing tagged values:

https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/tagged_value_broadcasts.html

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Notification When an Element is Modified
« Reply #4 on: September 11, 2018, 05:25:21 pm »
There is a (fairly) new set of events related to editing tagged values:

https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/tagged_value_broadcasts.html

Geert
Unfortunately, they are only relevant for AddinBroadcast tagged values.

But you could use them to force tagged value edits to go through your addin.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Notification When an Element is Modified
« Reply #5 on: September 11, 2018, 06:56:11 pm »
There is a (fairly) new set of events related to editing tagged values:

https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/tagged_value_broadcasts.html

Geert
Unfortunately, they are only relevant for AddinBroadcast tagged values.

But you could use them to force tagged value edits to go through your addin.
Ahh, too bad   :'(

Would be nice to have such a general "taggedValueModified" event thoug.

Geert