Skip to Content
avatar image
Former Member

script carry out sequence in design studio

Hello everyone.

Have you researched the sequence of design studio code carry out?which seems not carried out from top to bottom. Did them have any rules to carry out code? As follow code,if it carried from top to bottom,ANIMATION.setVisible(false) will carried last,But when I carried this code,the ANIMATION component never show. If I'm not add this code,the ANIMATION component will always show.Which seems ANIMATION.setVisible(false) carried first,so this component never show.

APPLICATION.setVariableValue("Z_SITE", "2001");
APPLICATION.loadDataSources([MON,YEAR]);
var edate = APPLICATION.getInfo().dateNowInternalFormat;
//??????
DS_2.setVariableValueExt("ZDAY", edate);
//??????7?
DS_2.setVariableValueExt("ZINT", "-7");
//????????,????sdate
var sdate = "";
var list = DS_2.getMembers("DAY1", 1);
list.forEach(function(element, index) {
  sdate = element.internalKey;
});
var arrGM =DS_2.getMembers("CALM", 1);
var v_calm="";
arrGM.forEach(function(element, index) {
  v_calm=element.text+"";
});
MON.setFilter("CALMONTH", v_calm,false);
YEAR.setFilter("YEAR", edate.substring(0,4),false);
GLOBAL_SCRIPTS_1.drop();
ANIMATION.setVisible(false);
APPLICATION.doBackgroundProcessing();

Is there anyone have researched it?

Waiting for your help.

Thanks.

Jing

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 19, 2017 at 03:30 PM

    Hi Jing,

    Your script includes a lot of data source manipulation statements. In my experience, in such cases the commands are not always executed serially/synchronously, leading to issues such as those you are experiencing. I am guessing that the ANIMATION component is intended to hide a busy indicator on completion of the data load. If that is the requirement then you should move the ANIMATION.setVisible(false) statement to the "On Result Set Changed" event script of the appropriate data source.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Jing. That makes sense. As mentioned before, I think the more likely cause of the issue is the timing of data source loading and set variable. Let me know your findings in that regard and we can proceed accordingly.

      Regards,

      Mustafa.