YS

Hello

I tried to use Context.writeStatus("Text") in my report.

My code like this:

function main() {

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

var aModels = group.ModelListFilter( 1 );

for ( var i = 0; i < aModels.length; i++ ) {
          Context.writeStatus("(" + (i+1) + "/" + aModels.length + ") " + aModels[i].Name(1049)); 

}

main();

But progress window is not shown.

Tell me please, how can I use the Context.writeStatus("Text")?

by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Thu, 11/05/2020 - 17:31

Perhaps your model list is empty ?    

var aModels = group.ModelListFilter( 1 );   only gets those models in the group of the type Org chart (and no models from the sub groups)

As you are doing not really anything, this would be quite fast, so it could be possible you don't see the status...

Regards,

Robert

0
by Yuriy Stolyarov Author
Posted on Thu, 11/05/2020 - 19:53

In reply to by rgoldenbaum

Hello Robert

Thank you for your answer

The list of my models is not empty (for simplicity, I did not give all the code, but the actions of creating objects on the models are successful). I agree that there are not many of them, only 7 models, but I put Dialogs.MsgBox ("Test") after Context.writeStatus("Text") for a delay, but that did not help.

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 11/06/2020 - 07:41

Just try to count from 1 to 10.000 and show this in the context...

0
by Yuriy Stolyarov Author
Posted on Fri, 11/06/2020 - 09:26

In reply to by rgoldenbaum

I tried this, even with 100 000 iterations, but no windows appeared.

Here is my code:

function main() {
    for (var i = 0; i < 100000; i++) {
     Context.writeStatus("Test text");
    }
}

main();

The option to show dialog boxes is already selected in the script settings. Maybe I need to include some other component?

0
by Kay Fischbach
Posted on Fri, 11/06/2020 - 11:25

In reply to by Felix101

Please be aware of the fact that the status window won't be shown while you're debugging the script. You're automatically debugging the script if you have it open while you execute the script in any way (even going to the "Explorer" tab and selecting some context object there to run the report will bring you back to your script, if it's opened - this is also considered debugging. Having breakpoints is not a condition for it to be considered debugging - an opened script will automatically be debugged).

Close your script and run the report by selecting a context object from the Explorer tab. (of course you need to tick that it's available for users in the report properties - if you don't want normal users to see the script because you're just testing stuff, the report properties also allow for limiting the report execution just to users of particular user groups if you're using ARIS 10).

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 11/06/2020 - 10:47

Hm ok this is strange - should be no problem (it works for me)...

Where do you want to "see" the Status ?   Connect / Windows Client ?    Which ARIS Version ?

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Fri, 11/06/2020 - 10:52

Ok, I got it - I tried your code and it was just too fast...  try it with this:

main();

function main() {
    
    for (var i = 0; i < 10000000; i++) {
     Context.writeStatus(i);
    }
}

Then you will see it...

0
by Yuriy Stolyarov Author
Posted on Fri, 11/06/2020 - 11:54

Hello Kay, thank you!

Thank you Robert too!

I ran the script in ARIS Architect (10.0.13) in debug mode (in the code editor), so I didn't see the displayed information, but if I ran the script on a small number of iterations, I wouldn't be able to see the messages too.
Now I can see messages from the Context.writeStatus command.
Thank you very much for your help!

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