Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: SteveC 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.
-
There's a hook (EAOnContextItemChanges IIRC out of memory). But it does not report TV changes.
q.
-
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..
-
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 (https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/tagged_value_broadcasts.html)
Geert
-
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 (https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/tagged_value_broadcasts.html)
Geert
Unfortunately, they are only relevant for AddinBroadcast (http://www.sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/predefinedtaggedvaluetypes.html) tagged values.
But you could use them to force tagged value edits to go through your addin.
-
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 (https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/automation/tagged_value_broadcasts.html)
Geert
Unfortunately, they are only relevant for AddinBroadcast (http://www.sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/predefinedtaggedvaluetypes.html) 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