Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: steen.jensen on November 29, 2021, 07:10:39 pm

Title: How replace duplicated elements to ONE master elements
Post by: steen.jensen on November 29, 2021, 07:10:39 pm
In EA Repository we have a lot of duplicated element for same objects.
How to replace those in an efficiant way??
- 3:rd party product (Expensive)?
- Own script (Difficult) ?
- Dont bother hmmm
Title: Re: How replace duplicated elements to ONE master elements
Post by: Paolo F Cantoni on November 29, 2021, 08:03:43 pm
Hi Steen,
I can provide some advice based on our experience...

As you may be aware, Sparx has a concept of "Time-Aware Modelling"  (a not very well named and too restrictive a process).  It involves creating clones of items so that you can change them without changing the original.

We use a similar concept when we need to create various options for "to be solutions" and then pick one to "run with" until the work package is completed.  This, then, poses the problem of how to re-integrate the updated clone into the mainline (similar to - but NOT to be confused with code branching).  We call this process "Promotion".  We developed a VBA Excel AddIn to handle three-way promotion of item features.  We can then extend this concept to that of "Consolidation" - automagically merging multiple "clones" into one.

You need to decide what YOU mean by promotion and consolidation.  Thus, I suspect, you won't find a third-party product to do the job for you.

Our Promoter / Consodildator works well for our needs.

I am happy to discuss what you need to consider when creating/evaluating such a tool (since if you are serious about creating a model - you CAN'T leave the "clones" alone)  if you (or others) are interested.

HTH,
Paolo
Title: Re: How replace duplicated elements to ONE master elements
Post by: qwerty on November 29, 2021, 08:46:16 pm
My question would be: how come? What is the reason for having duplicate elements. Usually there shouldn't be any. If so: which is the *real* one and what are the clones? And how do you cope with the different relations they got over time? Probably only a human can decide over that. In order to find them: how do you define a duplicate? Is it just the name? There might be duplicates with a different name but the same meaning. Well, clean up your modeling domain first, I would guess.

q.
Title: Re: How replace duplicated elements to ONE master elements
Post by: Paolo F Cantoni on November 29, 2021, 09:45:18 pm
My question would be: how come? What is the reason for having duplicate elements? Usually, there shouldn't be any. If so: which is the *real* one and what are the clones? And how do you cope with the different relations that got over time? Probably only a human can decide over that. In order to find them: how do you define a duplicate? Is it just the name? There might be duplicates with a different name but the same meaning. Well, clean up your modelling domain first, I would guess.

q.
There are many reasons for having "duplicate" items; once you define what duplicate means (as you say).  For example, in a separate Addin (currently non-functional), we are able to extract SQL Server Common Table Expressions (CTEs) and create separate items for each one we find.  These items have content, but (notionally) no name.  We can find CTEs with the same content (or only structure) and consolidate them into a smaller number of items.

For our part, the usual reason for duplicate items appearing in the repository is the integration of external repositories into our corporate repository.


Paolo
Title: Re: How replace duplicated elements to ONE master elements
Post by: qwerty on November 29, 2021, 11:02:12 pm
I know there might be reasons. I just was asking for steen's...

q.
Title: Re: How replace duplicated elements to ONE master elements
Post by: steen.jensen on November 30, 2021, 08:45:01 am
We are about 50 different modellers in 5 diffrent organisations that use a common Company Repository.
But not all users use the "Master" object when creating a new diagram or modell, so some systems as I.e the Corporate User & Role directory have about 25 diffrent objects with same name and meaning.
- Could be  that they does not understod the "Objects"  thinking in EA as they still "draw" as they did with Visio,
- Some does not bother to search if its already a master-object to use
- Or they just testing someting and then, next day that  modell is "perfect" and then its to late for them to change object...

Its possible to "manually" change the selected objects in diagrams to the master Object, but its takes time and are booring to move relations etc

Some sort of semi automatic with scripting should be feasble, I think, where a user is comfirming the switch for each diagram to a known master-object, where the script is checking all current relations, Notes, Attributes, Tagged-Values etc and making the switch
Title: Re: How replace duplicated elements to ONE master elements
Post by: Paolo F Cantoni on November 30, 2021, 09:15:06 am
We are about 50 different modellers in 5 different organisations that use a common Company Repository.

[SNIP]

Some sort of semi-automatic with scripting should be feasible, I think, where a user is confirming the switch for each diagram to a known master-object, where the script is checking all current relations, Notes, Attributes, Tagged-Values etc and making the switch
That is what our Consolidator does.  It also replaces the bad item in diagrams with the good diagram (in the same place and size).

There is, however, the problem of defining which items are to be processed - we use a special administrative relationship for that.

Also, since it's humans creating these anomalies, you might also consider a script to locate them as soon as they are created and making the user "an offer they can't refuse..." (with apologies to Don Corleone).

HTH,
Paolo
Title: Re: How replace duplicated elements to ONE master elements
Post by: qwerty on November 30, 2021, 10:08:25 am
Yes, it's al a question of good training. And even more of good control. Trust is good, but control is better (IIRC this is from Stalin which being a mass murder is not the best source, but truth is thruth, even spoken from a villain). So point A: make a good training. And B: prepare the offer that can't be refused. Just as Paolo said.

q.