Author Topic: Problem with modifing elements  (Read 2843 times)

ahauser

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem with modifing elements
« on: January 05, 2007, 03:29:26 am »
Hello,

I'm currently working on a synchronization tool between one of our applications and EA. So far everything works fine, I can create new elements in EA with the automation interface and assign values to the various properties.

But changing the values of existing elements doesn't work for some reason.
I'm using Delphi, the routine to change properties looks like this:

tmp:=FRepository.GetElementByID(Element_ID);
tmp.Notes:=NewNotes;
tmp.Update;

If I access the "Notes" property during a debug before I assign the new value, I get the correct text for this element. If I access the property after I assigned the new text (but without leaving this function), I get the new text. But when I load this element again after leaving the function above or starting EA again, the values weren't changed.

Did I forget to run a function? (Save or something similar)
Any ideas?

Thank you,
Andreas Hauser

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with modifing elements
« Reply #1 on: January 05, 2007, 04:10:28 am »
As far as I can see you are doing the right things. The notes should be saved.

Are you sure that the model is not being overwritten by the earlier version? I've seen situations where there were two channels into the model - for example where I have an external application interacting with an instance of EA that is also open on the desktop. It can be very easy to have one of the channels - and it could be either one at any given moment - working with the 'before' version of (usually) an element or diagram or (sometimes) much of the model. If that 'before' version is then changed and saved, it could silently overwrite the 'after' version the other channel is working on.

[Staring at the above paragraph I realize you sort of have to be there to see what I mean. But try to visualize it.]

Any chance something like this is happening?

BTW, how are you closing your EA model? The changes should be saved immediately, but who knows? Is there any chance that your application is buffering data?
No, you can't have it!