cancel
Showing results for 
Search instead for 
Did you mean: 

background processing

Former Member
0 Kudos

Hi Developers,

I have a quick question on Background Processing in Design Studio 1.3.  If I put APPLICATION.doBackgroundProcessing() statement in the begining of "On Startup", will the cursor wait for background processing to finish before executing rest of the code in Startup or system will execute On Startup and "background processing" at the same time?  Below is an example:

On Startup

{

APPLICATION.doBackgroundProcessing()

other logic within startup

-----------------------------------------

-----------------------------------------

-----------------------------------------

-----------------------------------------

-----------------------------------------

}

On Background Processing

{

Logic in background block

-----------------------------------------

-----------------------------------------

-----------------------------------------

}

Accepted Solutions (1)

Accepted Solutions (1)

Karol-K
Advisor
Advisor
0 Kudos

the answer is..

first all onStartup scripts will be executed, then the event for background processing will be triggered.

you can make small check:

1) select "Display Message Types: All"

2) place on startup:

APPLICATION.createInfoMessage("On Startup 1");

APPLICATION.doBackgroundProcessing();

APPLICATION.createInfoMessage("On Startup 2");

3) and on background processing:

APPLICATION.createInfoMessage("On Background");

the output will be (messages are sorted from bottom to top):

and this is the sequence how it will be executed.

Any special requirement for this question?

You can also execute background processing more times, for this, you need to create an integer variable and place this code (for 2 times execution):

APPLICATION.createInfoMessage("On Background : " + BACKGROUND_COUNT);

if(BACKGROUND_COUNT == 0){

  // the first time

}

if(BACKGROUND_COUNT == 1){

  // the second time

}

BACKGROUND_COUNT = BACKGROUND_COUNT + 1;

if(BACKGROUND_COUNT < 2) {

  APPLICATION.doBackgroundProcessing();

}

All answered?

Karol

Former Member
0 Kudos

Yes Karol. Thank you SO MUCH!!

Answers (0)