Book a Demo

Author Topic: Get Referenced Package from Tagged Value Reference within the Add-in  (Read 4571 times)

Erik0368

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

i created a profile with an element (called "Configuration") and used the <tagged value> - relationship to reference the metaclass "Package" (targetrole: SourcePackage)

Now the user is able to create a Configuration-Element and he can set the SourcePackage in the Tagged Values via Project-Browser Selection.

Traceability window Shows the Tagged Value reference to the package.

My Question:

Is it possible to get the referenced package or the package-GUID from the configuration-element within my addin?

element.TaggedValues.GetByName("string").value() only delivers the name of the package as string.

To search the package by name is not possible because the name ist not unique.

Thanks,

Erik

Nabil

  • EA User
  • **
  • Posts: 149
  • Karma: +5/-2
    • View Profile
    • View My LinkedIn Profile Here
If you have used the tagged value Type=RefGUID; then tag.value will give the GUID
HTH

BR
Nabil
Nabil

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
The resulting tagged value will indeed contain the GUID of the package as value.

You can use Repository.GetpackageByGUID() to get the package object

Geert

Erik0368

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
OK Thanks, my fold. The tag.Value() gives the GUID from the package.