Skip to Content
avatar image
Former Member

setVariableValueExt() ignored within On Variable Initialization when Load In Script = TRUE

Issue: When an applications data sources are set to load in script, attempting to set variables within On Variable Initialization ceases to work.

Workaround: Move setVariableValueExt() code to On Background Processing AFTER the data source has been loaded (i.e. DS_1.loadDataSource()).

Questions:

  1. Is this expected behavior?
  2. If we execute loadDataSource and then subsequently setVariableValueExt(), wont this refresh the data source twice?
  3. How does this work in scenarios where we have multiple data sources with different subsets of the total amount of variables used by the application? (e.g. DS_1 contains 2 out of 5 variables, DS_2 contains 3 out of 5 variables and so on and so fourth. In this scenario we would not be able to set variable values until a sufficient number of data sources have been loaded).

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 27, 2015 at 08:06 AM

    Hi Taygan,

    you have picked up quite complex topic ;-) I will try to answer, but still feel free to re-ask on details...

    1. yes, this is correct behavior - this event is triggered only once when the application is starting (shortly before onStartup event). It was done to have a place to react directly before the system tries to SUBMIT the variables to the BW server. The important point is the SUBMIT, not the SET event.

    2. No, there are script functions which are classified as "data changing" and others as "data requesting". as long the sequence is containing only the "data changing" scripts, there is no SUBMIT of variables (which costs time). This means, if you want to set 10 variables, you should make it in one sequence - and then you can call other scripts like getData or so. Making this in a mixed-sequence, the system will be forced to SUBMIT variables in between.

    3. see point 2, the loadDataSource script function is also "data changing".

    you can test your scenario with profiling parameter, see Design Studio Tips and Tricks: Measuring Performance.

    then, you should see the sequence like here (press "Refresh" button and expand until you find the SET_TEMPLATE command)

    In summary, the SUBMIT of variables will be triggered automatically on first call which is requesting data after the variables were un-submitted - and this is the effect of setting new variable value.

    Karol

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 27, 2015 at 05:40 AM

    Note: The contextual help for setVariableValueExt states that the data source is executed.

    Add comment
    10|10000 characters needed characters exceeded