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
-
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:
Session.Prompt("HELLO WORLD",1);
What am I missing?
-
You might not have a Session object when running as a model addin.
Try writing to the output, or using a messagebox
Geert
-
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.
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'.
-
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. :(