SO

Hi,

I want to find the model counts in the database grouped different types.

Can any one suggest how can i do this in a script.

by Ilya Seletkov
Posted on Mon, 10/14/2013 - 12:45
var oLV = new Object;
var sMsg = "";

//Active filter contains info about allowed model types. 
var oMetaModel = ArisData.ActiveFilter();

//Database
var oDB = ArisData.getActiveDatabase();

//List of models type nums
oLV.aTypeNums = oMetaModel.ModelTypes(Constants.ARISVIEW_ALL);

//For each type find list of models
for (var i=0; i<oLV.aTypeNums.length; i++)
{
   //List of models of i-th type
   oLV.aModels = oDB.Find(Constants.CID_MODEL, oLV.aTypeNums[i]);
   //Name of i-th type
   sMsg+= oMetaModel.ModelTypeName(oLV.aTypeNums[i]);
   sMsg+=": "+oLV.aModels.length+"\n";
   delete oLV.aModels;
}
delete oLV.aTypeNums;

Dialogs.MsgBox(sMsg);

Hope, this helps. It would better to improve output part, so as to write result to excel file. Because the result message could be very large in case of many model types used.

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

|
Nobody has collected any points yet this week. This is your chance to become one of the top 5 on this week's 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