Author Topic: Finding duplicate elements and replacing them  (Read 1863 times)

EA_enthusiast

  • EA User
  • **
  • Posts: 172
  • Karma: +0/-0
  • I'm a lifelong learner
    • View Profile
Finding duplicate elements and replacing them
« 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!
Thank you to all the contributors who spread their knowledge and experience!

qwerty

  • EA Guru
  • *****
  • Posts: 13525
  • Karma: +395/-300
  • I'm no guru at all
    • View Profile
Re: Finding duplicate elements and replacing them
« Reply #1 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.

EA_enthusiast

  • EA User
  • **
  • Posts: 172
  • Karma: +0/-0
  • I'm a lifelong learner
    • View Profile
Re: Finding duplicate elements and replacing them
« Reply #2 on: January 01, 2024, 01:58:09 am »
Thank you, qwerty. I will try that.
Thank you to all the contributors who spread their knowledge and experience!

ea0522

  • EA User
  • **
  • Posts: 90
  • Karma: +3/-0
    • View Profile
Re: Finding duplicate elements and replacing them
« Reply #3 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.

EA_enthusiast

  • EA User
  • **
  • Posts: 172
  • Karma: +0/-0
  • I'm a lifelong learner
    • View Profile
Re: Finding duplicate elements and replacing them
« Reply #4 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.
Thank you to all the contributors who spread their knowledge and experience!

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1322
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Finding duplicate elements and replacing them
« Reply #5 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.
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


EA_enthusiast

  • EA User
  • **
  • Posts: 172
  • Karma: +0/-0
  • I'm a lifelong learner
    • View Profile
Re: Finding duplicate elements and replacing them
« Reply #6 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.
Thank you to all the contributors who spread their knowledge and experience!