Profile picture for user ivo

Is there a way to check if a particular model type is used in some of the databases of one server? The model type is in the filter. The filter is used by all databases. However, the question is to find if there are any models created using that particular model type. The intention is to avoid checking each database as their number is big. Does anybody know a way to run script and check all DBs, or merge automatically all into one, with predefined setting for conflict resolution, or some other way as long as it's quicker than checking a big number of DBs one by one.

by Didier Nowak
Posted on Tue, 10/07/2014 - 15:08

Hello,



You can use this script to connect to all dbs of one server and output the number of models of the selected type.



Hope this helps...

var output = Context.createOutputObject();
var allDbNames = ArisData.GetDatabaseNames();
for (var i = 0; i < allDbNames.length; i++){
    var oCurrentDB = ArisData.openDatabase(allDbNames[i], "system", "xxx", "dd838074-ac29-11d4-85b8-00005a4053ff", Context.getSelectedLanguage(), true);
    if (oCurrentDB != null){
        var allModelsOfType = oCurrentDB.Find(Constants.SEARCH_MODEL,Constants.MT_EEPC);
        if (allModelsOfType.length > 0){
            output.OutputTxt(allDbNames[i]+": " + allModelsOfType.length+"\r\n");   
        }
        oCurrentDB.close();
    }else{
        output.OutputTxt(allDbNames[i]+": NO CONNECTION\r\n");
    }
}
output.WriteReport();

 

0
by Ivo Velitchkov Author
Posted on Tue, 10/07/2014 - 16:59

Thank you very much, Didier! This script is so useful.

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock