Skip to Content

Getting started with parallel processing is easy. Assign data sources to processing groups, set “Merge Prompts” to false, and just execute the application. šŸ™‚

While this is true in general, there are some things you need to know.


Parallel processing is not present in all phases of application execution. Four specific phases take advantage of parallel processing (see also Chapter 29.10 of Design Studio’s “Application Designer Guide”):

  • Initialization of data sources on start-up
  • Fetching result sets during rendering
  • Submitting variables
  • Data binding

As you might have noticed, the execution of script statements is not mentioned in the above list.

Beware the Script Execution

Design Studio scripts are always executed sequentially, that is statement by statement. When one statement is executed, it must rely on the fact that the execution of the previous statement has been completed. This rules out parallel execution of statements. For example, if a statement makes a decision based on a result that was computed with a previous statement, the script must be processed in the defined sequence in order to arrive at a reproducible result.

     var value = LISTBOX_1.getSelectedValue();

     if (value == “DeleteOrder”) {

          // …

     }

Keep this in mind when using script functions that access data sources.

But there is no need to worry, there are solutions around that deal with these circumstances.

Solution 1: Load Multiple Data Sources in Parallel During Script Execution

When you are initializing several data sources in a Design Studio script, try to centralize data source initialization in one place and use APPLICATION.loadDataSources(). This function can initialize the given data sources in parallel.

Traditionally initializing several data sources needed multiple script statements:

     DS_1.loadDataSource();

     DS_2.loadDataSource();

     DS_3.loadDataSource();

As mentioned above these three statements would be executed in sequence. However the initialization of several data sources is a quite common scenario. Therefore a new statement is available that allows parallelization for this scenario:

     APPLICATION.loadDataSources([DS_1, DS_2, DS_3]);


Note that this statement does not process all data sources in parallel, but according to their assignment to a processing group.

Solution 2: Use Property Binding

Property binding allows replacing sequential script statements with binding information of data sources to properties of components. The processing of property bindings takes part in the parallel processing.


Disclaimer: The usage of “Formatter Functions” imposed a significant performance overhead on property bindings in older versions of Design Studio. As of version 1.6 SP4 this overhead has been removed.

Property Binding – Simple Values

You want to set a text from a data source cell to a text field. Traditionally, a Design Studio script statement would retrieve the value of the cell with “getDataAsString” and assign it to the text property:

    var text = DS_1.getDataAsStringExt(“store_sales”, {});

    TEXT_1.setText(text);


When using property binding you create a property binding of type “Data Cell Binding” for the Text property of the text field:

dataBinding.png

Property Binding – Multiple Values

You want to populate a list box with members from a data source. Traditionally, a Design Studio script statement would retrieve the members with “getMembers” and assign it to the list box:

     var items = DS_1.getMemberList(“city”, …);

     LISTBOX_1.setItems(items);

When using property binding you create a property binding of type “Dimension Members Binding” for the Items property of the list box:

dataBinding_member.png

Summary

Script statements are always executed in sequence. Use property bindings and “loadDataSources()” to leverage the full potential of parallel processing. These can replace specific script statements with techniques that are executed in parallel.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Alfred Lee

    Hi Martin,


    Thanks for the explanation. I tried to follow your advice to use data binding, hoping that I can utilize parallel processing on startup.

    However, I cannot make it work as I expected.

    When I use data binding, its process time adds on top of parallel processing even I assign those datasource with different processing group.

    What did I miss?



    /wp-content/uploads/2015/11/1_834270.png.

    Thank you!

    Best regards,

    Alfred

    (0) 
    1. Bob Pfeiffer

      Looking at your screenshot I assume you are using Dimension Member Binding for filling a listbox or similar component. Unfortunately Dimension Member Bindings will not be processed in parallel before Design Studio 1.6 SP 1. See SAP Note 2256207.

      (0) 
    1. Martin Kolb Post author

      HiĀ Baudouin,

      the “loadDataSources” API is still available in 1.6.

      If it does not work for you then please, then please open a bug ticket.

      Regards, Martin

       

       

      (0) 

Leave a Reply