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")?
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
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.
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?
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).
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!