Working with base lines a cool thing. However, EA currently doesn’t provide a simple view to see all base lines at once. Actually to see all packages with base lines. With the flexibility of the model search, it is an easy task to provide a search which find all the needed information. Sure, you have to know the structure of the EA database. The most interesting tables can be found here.
Because baselines are created per package, the table t_package
will be used. But where is the baseline itself stored? Not in package t_package
, but in table t_documents
. Which also contains further information, next to baselines. When we have a closer look at the table t_documents
we see that all necessary information are actually contained. The package GUID is stored as ElementID
, the package type is stored as ElementType
.
Actually we don’t need more information to use the context menu in the result list to find the package in the project browser or in the diagram. However, maybe you would like to have more information from the package, that’s the reason for the join between t_documents
and t_package
. In the provided example, I have queried the package note and the package ID from the table t_package
.
Because EA allows to have multiple equally named elements, one could consider these packages are not the same, which could be the case. But in my example the package Model and Domain Model are always the same, each with multiple base lines. Each row represents one base line. With the package ID it is easy to determine if the packages are different or the same.
The big negative number in the column ID comes from the fact that the example is have used is a Replicated EAP file. Replicated EAPs get new and big Element IDs, which can also be negative! You have to keep in mind that Root Packages, in my case “Model” with the cannot be found in the project browser from the result list! The SQL query is the following:
SELECT t_package.ea_guid AS CLASSGUID, t_document.ElementType AS CLASSTYPE, t_package.Package_ID AS ID, t_package.Name, t_package.Notes as PackageNotes, t_document.Notes AS BaselineComments
FROM t_document INNER JOIN t_package ON t_document.ElementID = t_package.ea_guid
Here is a link to the query as Text.
The relevant Tables:
works great – thanks