Sparx Systems Forum

Discussion => Bugs and Issues => Topic started by: Mats Gejnevall on December 14, 2017, 03:25:00 am

Title: Avoiding deleting elements in use
Post by: Mats Gejnevall on December 14, 2017, 03:25:00 am
Hi all
I want to clean up my database of elements not in use. I use the Find orphan function and it lists a lot of elements not in use. But many of them are used in my information flows. Is there a way of detecting which orphaned elements are used in information flows? Or is there a configuration where they would not show up in that list?

Thanks Mats
Title: Re: Avoiding deleting elements in use
Post by: qwerty on December 14, 2017, 09:05:11 am
Maybe this one helps: https://stackoverflow.com/questions/47305307/sparx-ea-jscript-information-flows-realized/47310743#47310743 (https://stackoverflow.com/questions/47305307/sparx-ea-jscript-information-flows-realized/47310743#47310743) ?

q.
Title: Re: Avoiding deleting elements in use
Post by: Geert Bellekens on December 14, 2017, 06:00:12 pm
This search might help a bit, although it doesn't include conveyed items yet
https://bellekens.com/2015/10/16/searching-for-real-orphans-in-enterprise-architect/ (https://bellekens.com/2015/10/16/searching-for-real-orphans-in-enterprise-architect/)

Geert
Title: Re: Avoiding deleting elements in use
Post by: PJK on January 24, 2018, 02:42:23 am
Finding conveyed elements for information flows is messy - this clearly was added after the EA data model ossified. Here is a search that will tell you the source, target and flows conveying an element identified by its GUID:
SELECT Distinct o.ea_guid as CLASSGUID, o.Object_Type as CLASSTYPE, o.name As Source, c.name as Flow, trg.name as Destination

FROM t_object o, t_object trg, t_xref x, t_connector c
WHERE
'<Search Term>' IN (
#DB=SQLSVR#s substring(x.description,0,39), substring(x.description,39,39), substring(x.description,78,39), substring(x.description,117,39), substring(x.description,156,39), substring(x.description,195,39), substring(x.description,234,39),
substring(x.description,273,39), substring(x.description,312,39),substring(x.description,351,39)
#DB=SQLSVR#
#DB=Other#
left(x.description,38), mid(x.description,40,38), mid(x.description,79,38), mid(x.description,118,38), mid(x.description,157,38), mid(x.description,196,38), mid(x.description,235,38), mid(x.description,274,38), mid(x.description,313,38), mid(x.description,352,38)
#DB=Other#
)
AND x.Behavior = 'conveyed'
AND c.ea_guid = x.Client
AND o.object_id = c.Start_Object_ID
AND trg.object_id = c.End_Object_ID

order by o.name

You can write a simple script to get the element GUID from the project browser or a diagram, then call the search, or just copy/paste the GUID into the search parameter.