Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Mauricio Moya (Arquesoft) on February 24, 2023, 08:22:42 am

Title: EA_OnElementTagEdit not triggering
Post by: Mauricio Moya (Arquesoft) on February 24, 2023, 08:22:42 am
I'm creating a Model Addin (Broadcast Events/Tagged Value Events/EA_OnElementTagEdit), so I want to it trigger when the user change any tag value.

I create everything as it is supposed:
-Imported the Tagged Value Events from the Wizard
-Create a TagValueControlAddin
-Added the reception for EA_OnElementTagEdit
-Edit the internal code for the reception
-Save
-Specialize/Manage Addins and Enabled + Assigned to a security group (I belong to the group) + checked load on startup
-Then save, restart EA and reopen the project
-verified that the addin is still enabled in the manage addins windows
-Then changed some tag values, added some tag values, edited tag values from a MDG, etc. Nothing happened

The following is the code in the reception:
Code: [Select]
Session.Prompt("HELLO WORLD",1);
What am I missing?
Title: Re: EA_OnElementTagEdit not triggering
Post by: Geert Bellekens on February 24, 2023, 09:21:36 am
You might not have a Session object when running as a model addin.

Try writing to the output, or using a messagebox

Geert
Title: Re: EA_OnElementTagEdit not triggering
Post by: Eve on February 27, 2023, 09:42:04 am
I'm creating a Model Addin (Broadcast Events/Tagged Value Events/EA_OnElementTagEdit), so I want to it trigger when the user change any tag value.
Did you read the help for EA_OnElementTagEdit (https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/ea_onelementtagedit.html)? Here's the first sentence.
Quote
EA_OnElementTagEdit is called when the user clicks the Browse. button for a Tagged Value of type AddinBroadcast on an element.

This broadcast happens only if you have a tagged value with the type AddinBroadcast. It does not happen 'when the user change any tag value'.
Title: Re: EA_OnElementTagEdit not triggering
Post by: Mauricio Moya (Arquesoft) on March 02, 2023, 07:54:44 am
This broadcast happens only if you have a tagged value with the type AddinBroadcast. It does not happen 'when the user change any tag value'.

Ok, I just realized that. So there's no way to capture the event of edition of a normal tag value, unfortunately. :(