Book a Demo

Author Topic: Fast package/element deletes via automation?  (Read 3905 times)

bittercoder

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
  • .Net developer
    • View Profile
Fast package/element deletes via automation?
« on: January 08, 2007, 02:04:06 pm »
Hi All,

I'm looking for the fastest way to delete a Package or Element via Automation, when I know for instance the PackageGuid or ElementGuid...

At the moment I'm grabbing the parent of the package or element, iterating through the collection of children, finding the apropriate index for the element or package I want to delete, and then deleting via a call to:

Collection.RemoveAt(index, refresh)

This seems like a lot of work to do, just to delete an element or package (and is slow!) - surely I must be missing an easier way to do this?

dkkoenig

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Fast package/element deletes via automation?
« Reply #1 on: October 04, 2007, 05:14:18 am »
 ???
i have the same question

thomaskilian

  • Guest
Re: Fast package/element deletes via automation?
« Reply #2 on: October 04, 2007, 08:40:49 am »
DELETE FROM T_OBJECT WHERE ...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Fast package/element deletes via automation?
« Reply #3 on: October 05, 2007, 02:57:18 am »
Quote
DELETE FROM T_OBJECT WHERE ...

Sadly, that's it.

This whole business of having to iterate is really sad, particularly in large models.

Please Sparx, come up with something a little more intuitive.

David
No, you can't have it!

thomaskilian

  • Guest
Re: Fast package/element deletes via automation?
« Reply #4 on: October 05, 2007, 03:03:13 am »
Actually they have a Cache attribute for the repository. But the cache does not live long - obviously. When I work in the model then I have to use GetElementByID very often. And that seems to SQL each time. Easy for the EA programmer. Coffee time for for me :(