Book a Demo

Author Topic: How to get package GUID from an XMI?  (Read 4397 times)

franchox

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
How to get package GUID from an XMI?
« on: November 09, 2007, 11:19:03 am »
Hi everybody,
How can I get a package GUID from an XMI file?

Details:
- I open an empty .eap file and I need to import a package which I don't know what the GUID is.

Cheers,

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to get package GUID from an XMI?
« Reply #1 on: November 09, 2007, 11:24:39 am »
You should not need to know any package GUID to perform the import.

What am I missing in your description of the problem?
No, you can't have it!

franchox

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to get package GUID from an XMI?
« Reply #2 on: November 09, 2007, 11:53:09 am »
I'm using EA Java API to perform the import... and the first parameter that I have to use in ImportPackageXMI method is PackageGUID, so I need to know what's the GUID of the current package.
If there is another way to do this, please let me know...

Thanks...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: How to get package GUID from an XMI?
« Reply #3 on: November 09, 2007, 02:06:56 pm »
Aha!

What you need to supply is the package where the imported stuff will end up.

Usually this is some package in the model, which may well be replaced by what gets imported. In this case iterate through your model until you find the correct target package, then use the PackageGUID property to get what you need.

Other times you want to replace the entire model - this sounds like what you are doing here. In this case you need to provide the GUID of the root package of your model. Don't worry, EA will not let you delete the model root, so there's always one. Open your EA repository and inspect the Models collection; the first entry is the one you want.

[By the way, some of the calls require a GUID to be expressed differently - since the usual numeric string won't work in XML. If you have a problem with get a reference to the Project interface - you can get this through Repository.GetProjectInterface() - and use the GUIDtoXML and XMLtoGUID functions to translate back and forth.]

David
No, you can't have it!

franchox

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to get package GUID from an XMI?
« Reply #4 on: November 12, 2007, 04:56:39 am »
The problem was solved, thanks a lot...