Author Topic: React directly to model changes in C#-Addin  (Read 3955 times)

Shounbourgh

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
React directly to model changes in C#-Addin
« on: September 21, 2016, 06:22:53 pm »
Hi,

i am experimenting with the broadcast events for automated updates. I want react to connection creation / deletion. To do so, i modify the EA_PostNewConnector(...) - event in my C#-Addin. The problem i noticed is, that this event will only occur if the connector is created on a diagram. But there are a lot of other ways creating a connector (out of script, Project Browser -> Add -> Create Link, Addin itself). Whats the reason behind this architecture or am i just missing something (maybe overlooked a method) to interpose directly to model change notifications?

Thanks
Erik

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: React directly to model changes in C#-Addin
« Reply #1 on: September 21, 2016, 06:40:04 pm »
Eric,

If the event doesn't fire when creating a connector otherwise then you should report that as a bug to sparx.

Geert

Shounbourgh

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
Re: React directly to model changes in C#-Addin
« Reply #2 on: September 21, 2016, 06:57:04 pm »
Hi Geert,

strictly speaking (in regards to the documentation) it isnt a bug (e.g. for EA_OnPostNewConnector):
"This event occurs after a user has dragged a new connector from the Toolbox or Resources window onto a diagram. The notification is provided immediately after the connector is added to the model."

But it feels kinda incomplete/inconsistent that events are only created when diagrams gets modificated

But i'll try to get out the best with report this as a bug.

Thanks for your fast reply. Always impressed :)

Erik

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: React directly to model changes in C#-Addin
« Reply #3 on: September 21, 2016, 08:52:10 pm »
It may not be a bug according to the literal documentation, but definitely one according to the common sense.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: React directly to model changes in C#-Addin
« Reply #4 on: September 22, 2016, 12:21:27 am »
[suspicious]I guess that the design of EA and common sense do not have much in common :-\

q.[/suspicious]