Book a Demo

Author Topic: change the value of element.ExtensionPoints  (Read 4284 times)

ChrisM

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
change the value of element.ExtensionPoints
« on: June 23, 2009, 06:35:58 pm »
Hi there. I am trying to set the value of ExtensionPoints programmatically. I set the value to a string, call update on the element, but when I read back the element (using Repository.GetElementByGuid) the value is back as an empty string.
Does anyone know where in the database tables this value is being stored or why the update call would not store the change?
Thanks,
Chris

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: change the value of element.ExtensionPoints
« Reply #1 on: June 23, 2009, 09:30:51 pm »
Could it be that you need to Refresh() the collection that contains the element? Perhaps you need to reload the project (or some subset thereof) instead.
No, you can't have it!

ChrisM

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: change the value of element.ExtensionPoints
« Reply #2 on: June 23, 2009, 11:07:57 pm »
I am changing other fields of the element at the same time and calling update. The other fields (e.g. Alias) are updated fine, but not the ExtensionPoints :'(

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: change the value of element.ExtensionPoints
« Reply #3 on: June 24, 2009, 10:28:46 pm »
My point stands regardless. Attributes that affect position are reflected collections of entities, rather than the entities themselves. EA often returns (or fails to return) items from a outdated collections until you Refresh() the collection to reflect new element values. [That is, the Refresh() method causes the collection to reload the elements.]

I am guessing here, but perhaps you are still retrieving the old position information from the owning collection somehow.
No, you can't have it!

ChrisM

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: change the value of element.ExtensionPoints
« Reply #4 on: June 24, 2009, 11:48:51 pm »
I am not sure what you mean. I call to get reference to an element from the repository. I then change some of the values of the element and call update().
After that, I call GetElementByGuid from the repository again. All of the element changes have taken effect with the exception of the ExtensionPoints string. No collections involved!

Is the ExtensionPoints string converted to a collection internally? I am still struggling to find where the ExtensionPoints field is stored in the database tables. Any ideas?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: change the value of element.ExtensionPoints
« Reply #5 on: June 25, 2009, 09:09:08 am »
Imagine for a moment that you got the element from some collection. Something along the lines of ParentPackage.Elements.GetByName() or ...GetAt().

If you changed something that related to where in the group (i.e. collection) the element could be found, you might not see the changed reflected until you called ParentPackage.Refresh(). The most obvious example of this would be if you deleted the element from the collection and immediately enumerated the collection again. You could 'successfully' retrieve the element, even though it no longer existed, leading to all kinds of strange errors if you tried to do anything useful. That's because the collection has not reloaded and 'thinks' all its members are still there in the original order.

As I said earlier, I am not sure whether this would apply in this case, but it is worth checking out. See if you can find the parent collection and force it to reload via Refresh(). If not, then at least reload the package 'above' the entity you've modified. [Check the Repository and Project classes.]

And please post back with any results you get.
No, you can't have it!