Author Topic: Workflow Events  (Read 2086 times)

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Workflow Events
« 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
Models are great!
Correct models are even greater!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Workflow Events
« Reply #1 on: November 29, 2022, 01:21:22 am »
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)

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

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Workflow Events
« Reply #2 on: November 29, 2022, 01:43:10 am »
Thanks Geert most useful info as usual.

many thanks

Phil
Models are great!
Correct models are even greater!