Book a Demo

Author Topic: How to retrieve Package Properties frm Repository  (Read 3085 times)

ashwinib

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
How to retrieve Package Properties frm Repository
« on: June 19, 2008, 04:24:41 pm »
Hi,

I am working on Addin which will generate a report of package properties selected by user.

I need to retrieve all the properties of the selected package.

I tried getting them from

GetTreeSelectedPackage().Element

But it does not give everything that is displayed in Property page of Package.

For e.g., to Retrive the links of the packages.

1. need to retrieve the connectors of element
2. get the client id of each connector.
3. From Client id get the details
       GetElementById(ClientId)

Is there any Direct method with which i would get all the properties of package, displayed in Property Window.

Please assist.
« Last Edit: June 19, 2008, 07:06:10 pm by ashlly »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to retrieve Package Properties frm Reposit
« Reply #1 on: June 19, 2008, 09:34:53 pm »
AFAIK you will need to use both the Package and the (underlying) Element instances.

EA treats a Package as a special case of Element (which of course actually is the case). Most 'common' properties - those shared by most element types - are stored in the Package.Element instance. Other properties that are specific to the package are stored in the Package instance itself. There are three important caveats to the above:
  • When I say they are "stored in" an instance I mean that this is where you retrieve them from; they might actually be stored in an associated table in the EA schema.
  • Some properties are stored redundantly; there are only a few of these - such as the name of the package - and they are pretty obvious.
  • The 'split' between these two property sets seems to date back to early EA versions; there is no 'guarantee' that they follow any pattern in the UML specification, but common sense will generally help you decide where to look.
HTH, David

PS: From an automation client that reads the database directly, if you have either element you should be able to quickly retrieve the other by using the same GUID.
« Last Edit: June 19, 2008, 09:36:28 pm by Midnight »
No, you can't have it!