Merge Relationships

Started by nickbrown1968, June 05, 2024, 11:12:03 AM

Previous topic - Next topic

nickbrown1968

I occasionally end up with duplicate relationships between elements. What's the best workflow to "merge" them? I currently do something along the lines of:

- Rename the to make them unique/identifiable (if not already)
- Pick a the one that needs to be kept
- Select the one to be deleted, open all views where used
- Recreate the connection in the view, selecting the existing relationship to be kept
- Delete the original connection in the view
- When removed from all views, delete relationship from model

Is there an easier way?

romuald

Maybe a Jarchi script can do this.
You can find a MErge script for elements like : Merge Elements Script

Changing
var el_selection = selection.filter("element");

By
var el_selection = selection;

merge 2 relations if they are same type.
It will not remove duplicate relations in views

Phil Beauvoir

If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Alexis_H

Hi all,

Following Phil direction to jArchi relation merge() option, I ended up editing the community-script provided by JB Sarrodie that already merges concepts to also handle relations.

My use-cases included merging of different class of relations (ie : redundant association vs composition) so the script also ask if you want to mutate relations before merging, and swap source/target if required.
A few test made it worthwile for my use-cases, but as always : use with caution, I don't take responsibility if your model is messed up ;)


If of interest to anyone there it is :
https://github.com/AlexisHFr/jarchi-community-script-pack/blob/b4800510350761d548077180618526f58d97e557/Utils/Merge%20multiple%20concepts%20(and%20delete%20others).ajs