Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: EA_enthusiast on December 30, 2023, 03:36:02 am

Title: Finding duplicate elements and replacing them
Post by: EA_enthusiast on December 30, 2023, 03:36:02 am
Hello EA Experts,

I inherited multiple models/files and found that managing/maintaining them separately would be a nightmare. I merged all the models/files into one model/file. Now, I have duplicate elements in the master model. For example:

Class A (instance 1)---> appears 10 times
Class A (instance 2)---> appears 7 times
Class A (instance 3)---> appears 3 times

What is the most effective and efficient way to:
(1) Find the frequencies (number of appearances) of each element (as shown above)
(2) replace Class A (instance 2) and Class A (instance 3) with Class A (instance 1)

Thank you so much!
Title: Re: Finding duplicate elements and replacing them
Post by: qwerty on December 30, 2023, 08:58:44 am
Probably a query by count for the name would be a way (differs for DB types). You can script replacement. Not impossible but a bit tricky since you have to find and fix the connectors and the appearances in various diagrams.

q.
Title: Re: Finding duplicate elements and replacing them
Post by: EA_enthusiast on January 01, 2024, 01:58:09 am
Thank you, qwerty. I will try that.
Title: Re: Finding duplicate elements and replacing them
Post by: ea0522 on January 08, 2024, 06:50:20 pm
There is an IDEA add-on that does deduplication on elements and connectors.
See https://data-docent.nl/ideaen.aspx#gsc.tab=0 (https://data-docent.nl/ideaen.aspx#gsc.tab=0).
Title: Re: Finding duplicate elements and replacing them
Post by: EA_enthusiast on January 09, 2024, 06:19:19 am
Quote
There is an IDEA add-on that does deduplication on elements and connectors.
See https://data-docent.nl/ideaen.aspx#gsc.tab=0.

Thank you for sharing this. I didn't know about this addon. I'll check it out.
Title: Re: Finding duplicate elements and replacing them
Post by: Guillaume on January 09, 2024, 07:12:06 pm
Unless you need to merge all 3 versions of your Class A, if there is an interest in having a view of each version in your repository, you could create a master Class A linked via a dependency (or other link) to each existing Class A element.
Title: Re: Finding duplicate elements and replacing them
Post by: EA_enthusiast on January 10, 2024, 03:34:18 am
Quote
Unless you need to merge all 3 versions of your Class A, if there is an interest in having a view of each version in your repository, you could create a master Class A linked via a dependency (or other link) to each existing Class A element.

Thank you for your response. I don't need to merge all 3 versions of the Class A. If I understand your suggestion correctly, you suggest creating a master "Class A" linked via a dependency to each existing "Class A" element. This suggestion assumes that I have found and identified the duplicate "Class A" elements, which is not the case; it's actually the objective I am trying to achieve.