YS

Hello!

I wanna delete all models from the selected group.

My code is:

function delFiles() {

     var gr = ArisData.getSelectedGroups()[0];

     Dialogs.MsgBox("Selected group: " + gr.Name(1049));

     var delModels=gr.ModelList(true);

     Dialogs.MsgBox("Number of models: " + delModels.length);    

     for(var i = 0; i < delModels.length; i++){

          Dialogs.MsgBox("Del status of" + delModels[i].Name(1049) + " model: " + gr.Delete(delModels[i]));

     }

}

function main() {

     delFiles();

}

main();

All models are closed. I can delete their manually.

But status of deleting of each model by script is "false".

Tell me please why I can not delete models from selected group.

by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Tue, 06/11/2019 - 09:28

Try running from the end of the array to the start...

0
by Yuriy Stolyarov Author
Posted on Tue, 06/11/2019 - 10:48
Hello, Robert I tried it, but it did not help me:

function delFiles() {

     var gr = ArisData.getSelectedGroups()[0];

     Dialogs.MsgBox("Selected group: " + gr.Name(1049));

     var delModels=gr.ModelList(true);

     Dialogs.MsgBox("Number of models: " + delModels.length);    

     for (var i = delModels.length - 1; i >= 0; i--){

                   gr.Delete(delModels[i]);

     }

}

function main() {

     delFiles();

}

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Tue, 06/11/2019 - 11:33

Ahm, just try to delete the model without anything in a MsgBox...   Normally this command works just fine...

0
by Yuriy Stolyarov Author
Posted on Thu, 09/19/2019 - 09:14

Thank you Robert!

0
by Yuriy Stolyarov Author
Posted on Wed, 09/25/2019 - 11:14

Sorry, I forgot to check the checkbox writing in the base of the script.

After this checking the script run successfully.

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