Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: kuchejda on April 11, 2023, 02:18:32 pm

Title: How to find all hyperlinks to given element
Post by: kuchejda on April 11, 2023, 02:18:32 pm
Hello,
Is it possible to find all the elements that are hyperlinking to a given element?

For example, I have three use cases that all mention a requirement in their scenarios and provide a hyperlink to that requirement. Now that I have changed that requirement, I need to verify that all the places that link to it are still valid, but I don't know where to find them. I can of course use the full-text search, but that relies on the fact that I have used the name of the requirement in all the use cases, which may or may not be the case.

Thank you!
Title: Re: How to find all hyperlinks to given element
Post by: qwerty on April 11, 2023, 05:17:07 pm
That is possible, but a bit tricky. The hyperlinks are coded in the notes field of the elements. Looks like
Code: [Select]
n;
"<a href=""$element://{2AD45024-5CC4-4314-9721-FEEFE0EC7937}""><font color=""#0000ff""><u>after flow</u></font></a> ";
So if you substitute the guid and search for the beginning of such a string
Code: [Select]
SELECT * FROM t_object WHERE note LIKE '$element://{<guid>}you should be able to locate the elements.

Using scripting would be an alternative way.

q.
Title: Re: How to find all hyperlinks to given element
Post by: kuchejda on April 14, 2023, 11:46:05 am
Thank you for the help! I have created this search query and it seems to work perfectly (it searches in Scenarios instead of Notes)

Code: [Select]
SELECT tob.ea_guid AS CLASSGUID, tob.Object_Type AS CLASSTYPE, Name as Element
FROM t_object tob
join t_objectscenarios tsc on tsc.object_id = tob.object_id
WHERE tsc.notes LIKE '%$element://' + (select ea_guid from t_object where name like '%<Search Term>%') + '%'