I'm trying to write a script that will result in a collection containing a filtered set of elements. I'm looking to only include elements that contain a specific property name and value. I further want to filter the list of elements by the folder they reside in. Actually, I want to exclude elements that reside in two specific folders in my model tree. So show me all elements in the model with a specific property and value that do not reside in folder A or folder B. The properties filter is pretty straight forward but I am not sure how to incorporate the folder check into a script. Any thoughts or suggestions are welcome! Thx.
This will return a collection of elements that are not members of folders called "Applications" and "Processes":
var collection = $('element').filter(function(element) {
var folder = $(element).parent().first();
return folder.name != "Applications" && folder.name != "Processes";
})
Hi,
also look at the code shared here (it gets the object "path"): https://forum.archimatetool.com/index.php?topic=976.msg5311#msg5311
Regards,
JB
Thank you for the suggestions and code sample.
-Kevin