Skip to content

Instantly share code, notes, and snippets.

View stefjoosten's full-sized avatar

Stef Joosten stefjoosten

View GitHub Profile
@stefjoosten
stefjoosten / Merge all equal name-type elements.ajs
Created December 30, 2020 14:12
This jArchi-script ensures that all elements that share type and name are one and the same element. This will not affect any of your views. Executing this script is idempotent.
/* Merge all equal name-type elements.ajs
* Situation: Archi can make an element show up in different views. The relationships to and from that element in all these views are attached to the same element.
* Problem: If I accidentally make a copy of an element (e.g. by copying a view from one model to another), multiple elements may arise that have the same type and name.
* Such copies do not share relations, which violates an important benefit of Archi.
* Solution: This Archi-script ensures that all elements that share type and name are one and the same element. This will not affect any of your views. Executing this script is idempotent.
* Impact: after running this script
* - you will see that double occurrences in your elements list (in the "Models"-pane of Archi) are gone;
* - the information of all double occurrences has been accumulated in the remaining one without losing any information;
* - you will also see that the properties of the merged elements are all included in the re
@stefjoosten
stefjoosten / Show duplication.ajs
Created December 29, 2020 09:19
This jArchi-script shows which Archi-elements in a model share the same type and name.
/* Show duplication.ajs
* Situation: Archi can make an element show up in different views. The relationships to and from that element in all these views are attached to the same element.
* Problem: If I accidentally make a copy of an element (e.g. by copying a view from one model to another), multiple elements may arise that have the same type and name.
* Such copies do not share relations, which violates an important benefit of Archi.
* Solution: This Archi-script signals the situation, so you can fix it if you want.
* (c) 2020 by Stef Joosten
*/
var debug = true;
debug ? console.show():true;