Book a Demo

Author Topic: GetPackageByGuid returns Nothing for Requirement Type Packages in EA  (Read 3576 times)

mohankishor

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Hello,

We are using Enterprise Architect v15.2 in our project.

We are trying to export the diagrams from EA through Scripts.

We have a few packages created by EA itself and few packages as import from IBM Rational DOORS.

When we try to use GetPackageByGuid() from Repository Class ( https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/repository3.html ) for a package created in EA itself, it returns the packages as expected.
But when we try to use GetPackageByGuid() for a package created in EA as an import from IBM Rational DOORS, it returns Nothing.

The difference I see in EA in both the above packages is that the type of the Package is "Requirement" for the DOORS imported package whereas type of the package is "Package" for the package created via EA directly.

Is this an expected behavior of this function? If so, do we already have any other function to get such "Requirement" Type Packages?

Thanks!!
« Last Edit: April 29, 2021, 04:08:03 pm by mohankishor »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: GetPackageByGuid returns Nothing for Requirement Type Packages in EA
« Reply #1 on: April 29, 2021, 05:01:28 pm »
Are you sure the "packages" you are talking about are really packages?

Looks like they are really just elements. (maybe with a package icon?)
Try if you can get a result using Repository.GetElementByGUID

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: GetPackageByGuid returns Nothing for Requirement Type Packages in EA
« Reply #2 on: April 29, 2021, 06:14:39 pm »
Are you sure the "packages" you are talking about are really packages?

Looks like they are really just elements. (maybe with a package icon?)
Try if you can get a result using Repository.GetElementByGUID

Geert
Wot 'e sed!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

mohankishor

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: GetPackageByGuid returns Nothing for Requirement Type Packages in EA
« Reply #3 on: April 29, 2021, 08:47:15 pm »
Are you sure the "packages" you are talking about are really packages?

Looks like they are really just elements. (maybe with a package icon?)
Try if you can get a result using Repository.GetElementByGUID

Geert

Yes correct. GetElementByGUID returns the element properly.