Author Topic: Is package X included in any <<model document>>?  (Read 2803 times)

stereotype

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Is package X included in any <<model document>>?
« on: February 14, 2019, 11:07:46 pm »
A simple(?) question regarding RTF document generation that I haven't found an answer to: from a <<model document>> it is easy to locate the included packages, but how can I find out which <<model document>>(s) - if any - a specific package is included in...?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13380
  • Karma: +563/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Is package X included in any <<model document>>?
« Reply #1 on: February 14, 2019, 11:39:36 pm »
I got curious, so I had a look in the database.

Turns out the attribute links to the t_object row of the package using the classifier field.

This SQL query should return the attributes in the model documents referencing the selected package:

Code: [Select]
select a.ea_guid AS CLASSGUID, 'Attribute' AS CLASSTYPE, o.Name as ClassName, a.Name as AttributeName, a.Type, a.Stereotype, a.Notes as Description
, package.name as PackageName ,package_p1.name as Package_level1,package_p2.name as Package_level2 ,package_p3.name as Package_level3
 from (((((((t_attribute a
inner join t_object o on o.Object_ID = a.Object_ID)
inner join t_object po on po.Object_ID = a.Classifier)
inner join t_package p on p.ea_guid = po.ea_guid)
inner join t_package package on package.Package_ID = o.Package_ID)
left join t_package package_p1 on package_p1.package_id = package.parent_id)
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id)
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id)
where
p.Package_ID = #Package#

Geert

stereotype

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Is package X included in any <<model document>>?
« Reply #2 on: February 15, 2019, 12:18:21 am »
Thanks a lot! I haven't tried it yet, but will!
« Last Edit: February 15, 2019, 12:20:17 am by stereotype »