Created
March 2, 2020 15:33
-
-
Save jbsarrodie/aae4ed4981ada94834cfdf48d978a13f to your computer and use it in GitHub Desktop.
#jArchi scripts to delete any element (or relationship) not used in at least one view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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