Skip to Content
0

script carry out sequence in design studio

Jul 19, 2017 at 09:26 AM

94

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Mustafa Bensan Jul 19, 2017 at 03:30 PM
0

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.

Show 6 Share
10 |10000 characters needed characters left characters exceeded

Hi Mustafa.

What means "On Result Set Changed",and when executed?Compare with "On Start up",which one execute first?

And because I have data source manipulation,the commands are not executed serially?From this,whether it means some component function will execute before data source manipulation?That's my confuse.

And I have action as you said,but still false.

Thanks.

Jing

0

Hi Jing,

The "On Result Set Changed" event is related to a data source as shown in the screenshot below. The script code for the event is executed when any change occurs to the data source result set.

"And because I have data source manipulation,the commands are not executed serially?" Because you are using script commands like setVariableValueExt(), loadDataSources() and setFilter(), the execution sequence is not necessarily sequential. Furthermore, if you have parallel query processing enabled, then I would expect that the script execution would continue while loadDataSources() is executing.

I also notice that you are using doBackGroundProcessing() which adds to the complexity of sequencing. You should make sure you are using this method correctly. There is a good example in the blog Optimize the performance of your SAP BusinessObjects Design Studio solutions - tips and tricks, in section 3. Initialize data sources in "background processing".

It would be helpful if we went back to the basics and you explained in more detail what the ANIMATION component is and what you are trying to achieve with it.

Regards,

Mustafa.

1

Hi Mustafa.

Thanks you for your reply.

I have read your recommended documents. But it doesn't work for me.

I just want a loading data animation effect,so I'm use css3 write a class to realize,and banding to the ANIMATION component.I'm sure my class is OK,because I've run it ok if I never set "ANIMATION.setVisible(false)".

And I will back you latter whether it's because APPLIACTION.loaddatasource or setVariable.

Thanks.

Jing

0

Hi Jing,

Thanks for the clarification. The issue is probably not related to the CSS but more about the timing of loading of data sources and variable setting. Is your ANIMATION component a custom SDK component or a standard component just with custom CSS applied?

Regards,

Mustafa.

0

Hi Mustafa.

My ANIMATION component is a standard component.I just use a "Panel" standard component,which contained 3 TEXT component,banding a class to realize animation effect.

Thanks.

Jing

animation.png (5.2 kB)
0

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.

0