Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: philchudley on November 29, 2022, 12:25:35 am
-
Hi All
There is a workflow broadcast event that is named EA_AllowPropertyUpdate for which the EA user guide states:
"This event is sent to workflow Add-Ins after a user has changed a built-in property value."
However, upon testing this, it appears that a change to the element Name property does not trigger this event, where as a change to version does
trigger this event. There may be other properties that trigger this event, but I would really like to detect an attempt to change the name property.
I seem to recall in the dim distant past when Workflow scripts were introduced, there was a list of property changes that we detected, I guess Name is not one of them.
Phil
-
Phil,
I wouldn't invest too much int he workflow scripts stuff as they have been deprecated by Sparx (see the red note on https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/workflow_scripts.html (https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/workflow_scripts.html))
For regular add-ins (and I guess the new add-in scripts), you can use the EA_OnContextItemModified event, to check for changes to the name.
The trick to detect a name change, is to also listen to EA_OnContextItemChanged, and then register the name of the element. It it has been changed when the EA_OnContextItemModified event is triggered, you can reverse it if needed.
Geert
-
Thanks Geert most useful info as usual.
many thanks
Phil