Hi guys!
Do you have any script that helps to delete objects (functions) that doesn't have occurence?
Regards!
Hi guys!
Do you have any script that helps to delete objects (functions) that doesn't have occurence?
Regards!
Hello,
the standard way of doing this is to reorganize the database. If I'm not mistaken, you need database administration privileges to do this. The reorganization eliminates ALL objects without any occurrence in any model. So be sure to take care of any object libraries you may have that you have library models with an occurrence of all objects you want to keep.
Warning: There is a known Bug, that connection occurrences, which only occur in matrix models are not preserved in reorganizations (Pivotal 5145392). There is a configuration parameter to control this behaviour, which unfortunately does the opposite from what it says. This Bug is fixed with the Service Release 9.6 SR2014_01 published today.
Regards, M. Zschuckelt
Hi Pedro,
to delete every function without occurrences for all the database, the code should be like this one :
var functions = ArisData.getActiveDatabase().Find(Constants.SEARCH_OBJDEF, 22); for(var i = 0; i < functions.length; i++){ if(functions[i].OccList().length == 0){ var group = functions[i].Group(); group.Delete(functions[i]); } }
It should work.
Save your data base before running this script, the result is definitive
Best Regards,
Thank you very much M. Zschuckelt!!! I'll try!
Regards from méxico! :D
Thaks Tricarico!!
I'll do a test modifying your code, 'cause I have 8 different types of Function as custom function objects.
Thanks a lot!!! It would be helpful.
Regards from Mexico City! :D
Hi Pablo,
Be careful, you don't have different types of functions, there is only one type of function with the type number 22 in Aris.
I think you created different symbols to identify several concepts of functions. So you will have to use the function Find with the correct arguments to search function by default symbol. If you are using the code I wrote before, it will perform on every "types" of function (Process, activities, tasks, controls etc...).
best Regards from Paris ;-)