Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#jArchi scripts to delete any element (or relationship) not used in at least one view
// Delete unused elements and relationships
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script will delete any element or relationship not used in at least one view
//
// (c) 2020 Jean-Baptiste Sarrodie
var response = window.confirm("This script will delete any element or relationship not used in at least one view. Continue?");
if (!response)
exit();
$("concept").each(function(c) {
if($(c).objectRefs().isEmpty()) {
c.delete();
}
});
// Delete unused elements
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script will delete any element not used in at least one view.
// (only relationships having such element as source or target will be deleted too)
//
// (c) 2019 Jean-Baptiste Sarrodie
var response = window.confirm("This script will delete any element not used in at least one view. Only relationships having such element as source or target will be deleted too. Continue?");
if (!response)
exit();
$("element").each(function(e) {
if($(e).objectRefs().isEmpty()) {
e.delete();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment