During a team review of our Enterprise Architect project, we needed to find the controlled package matching an XML file located in the SVN repository (the EA project was set up on a SQL Server database, coupled with an SVN repository).
It turned out that this XML file wasn't used any longer by Enterprise Architect: a package had been de-controlled from SVN, in which case the associated file is not deleted from the SVN repository. The following example illustrates an Actors package, initially controlled, and after it has been de-controlled:
Enterprise Architect Project Browser:
Windows Explorer with TortoiseSVN icons before and after de-controlling the actors Package:
To find as whether an XML File identified in the SVN repository is still associated with a controlled package, I created the following Enterprise Architect user defined search (SQL editor type), FindControlledPackageFromFile:
SELECT p.ea_guid AS CLASSGUID, o.object_type AS CLASSTYPE, p.name, p.XMLPath AS PathtoXMI
FROM t_package p left join t_object o on p.ea_guid = o.ea_guid
WHERE p.XMLPath LIKE '*<Search Term>*' AND p.IsControlled = true
Running the search with the provided filename didn't return any matching controlled package, confirming that this controlled XML file is no longer used in the Enterprise Architect project. Hence this XML file could be deleted from the Subversion repository without any impact on the modelling project.
This Enterprise Architect user-defined search can also be used to find the controlled package associated with an XML file seen in the SVN repository, where its location and filename no longer provide any clue on the package it controls.
The following example illustrates how to find the controlled package "Primary Use Cases" associated with Business Requirements.xml. Once executed, the package found can be selected to be displayed in the Project Browser.
The associated XML files can be checked from the Primary Use Cases' "Package Control Configure" dialog window:
Note: running this search with an empty criteria returns all controlled packages and associated XML files (name + full path).