Book a Demo

Author Topic: EA_OnNotifiyContextItemModified  (Read 4082 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
EA_OnNotifiyContextItemModified
« on: May 01, 2013, 12:14:31 am »
Hi
In my addin I have some code that checks the validity of a connector when it is created. I handle this in EA_OnPreNewConnector
But now,of course, the user can move the connector to an 'illegal' element.
I know I can catch the context item modified event but there seems no way to to the modification
Is there a way for me to achieve this?

Thanks
Using V12

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA_OnNotifiyContextItemModified
« Reply #1 on: May 01, 2013, 01:21:59 am »
No. A bad flaw in EA's design. This method should deliver the before- and after-values.

q.

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: EA_OnNotifiyContextItemModified
« Reply #2 on: May 01, 2013, 01:58:29 am »
 :'(
Using V12

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: EA_OnNotifiyContextItemModified
« Reply #3 on: May 01, 2013, 06:32:43 am »
... and there are other situations where you will run into the same kind of problem.

You can of course use the EA model validation broadcast events to create some custom consistency checks on the model and have your users run that before checking in changes.
« Last Edit: May 01, 2013, 06:35:36 am by pmaessen »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA_OnNotifiyContextItemModified
« Reply #4 on: May 02, 2013, 03:54:15 pm »
If you need something like that you'll need to register the "old" values in another event (such as EA_OnContextItemChanged) and then compare the new values with the old values.

Geert

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: EA_OnNotifiyContextItemModified
« Reply #5 on: May 02, 2013, 05:03:43 pm »
Thanks Geert
This is in fact what I have done, if a user attempts to move the connector to an 'illegal' place I pop up an message box and return the connector to its original place

Using V12