Book a Demo

Author Topic: EA_OnNotifyContextItemModified - AttributeName  (Read 5409 times)

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
EA_OnNotifyContextItemModified - AttributeName
« on: July 28, 2015, 05:34:24 pm »
Hi there,

I got a problem with the EA_OnNotifyContextItemModified event of EA.

I want to get notified when a Attributename gets changed, but the EA_OnNotifyContextItemModified Event will just fire onto the containing element - not on the attribute itself.

The event will just fire when I change a taggedvalue on the attribute, but not if I change the name or the stereotype of something like this.

Is there a way to know what attribute changed when I change it's name?

Regards,
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #1 on: July 28, 2015, 07:08:09 pm »
Not directly. You need to make a cross reference on project load. Now you can lookup your guid based table for the previous name.

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #2 on: July 28, 2015, 07:29:54 pm »
Seriously?

We got more than 7000 Attributes in our diagrams,... It's insane to hold a view with those information just because EA's not throwing any events when you change the name of an attribute (I mean what is this event even for if not for the change of a name, stereotype or value >:( )

The more I work with creating those Addins the more I am frightened of EA's Addin Interface and their way of realization...  :-X

Edit:
I mean, the name is just an example. I just want to get notified in some way when something changed on an attribute - what it is - I don't care (Type, Scope, Name, Stereotype, Alias, Initial value) - I just need to know which attribute changed.

I won't hold a table with a several thousend rows just to check every colum if a value has changed, to get to know what attribute "might" have actually changed.

« Last Edit: July 28, 2015, 07:36:23 pm by ericeckstein »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #3 on: July 28, 2015, 11:11:20 pm »
Yes, sigh. But that's the way it is. It's EA...

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #4 on: July 28, 2015, 11:28:29 pm »
Quote
Yes, sigh. But that's the way it is. It's EA...

q.

Hey, thanks for your answer again: I tried something and I think I got a kind of workaround for this behaviour. (At least it works for attributes).

If you "subscribe" to EA_OnContextItemDoubleClicked you will get notified if you open the containing element also as if you "double-click" the attribute itself.
Since a "F2" push onto both will be handled by this event to and attributes are not changeable in objectbrowser I think there is no way around this event if you want to change the attribute.

So i just craete a small list of contained attributes by this specific element (if you doubleclick the attribute you can get it by ParentID) and when the event for change on the element is fired I can loop over this list to see if something inside changed  ;)

Regards,
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #5 on: July 28, 2015, 11:38:17 pm »
Now I remember. I did something similar in the (distant) past. EA is tricky at quite some places and needs smart developers :-)

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #6 on: July 28, 2015, 11:46:08 pm »
Quote
Now I remember. I did something similar in the (distant) past. EA is tricky at quite some places and needs smart developers :-)

q.

Haha, this is kind of a tip on the hat to yourself ;)
But I took it as a compliment for myself, too  :-*

Well thanks for you help never the less, you lead me on the right way.

Regard,
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA_OnNotifyContextItemModified - AttributeName
« Reply #7 on: July 28, 2015, 11:49:21 pm »
Yeah - I'm smart sometimes. But as you see I'm oblivious too ;D

q.