Carl J


I'm having some issues when trying to call two datasources in a row, and use a SetOnDelayMessage in between the two.

What I'm trying to do is call a web service, and then depending on what is returned, I want to use SetOnDelayMessage and then call another web service. What happens though, is that the message from the SetOnDelayMessage is displayed, then the output from the first call and the second call are displayed in the same message.

procedure CallSecondWebService(INPUT)

MSG = "Processing ..."

touch datasource DoSomethingElse

call SetOnDelayMessage(5, MSG)

OBJ <= DoSomethingElse(INPUT)
- OBJ.ReturnedValue2

procedure CallFirstWebService(VARIABLE)

touch datasource DoSomething

OBJ <= DoSomething(VARIABLE)

- OBJ.ReturnedValue1

call CallSecondWebService(OBJ.ReturnedValue1)

This is the output that I get when I run it

MSN says:

Processing ...
MSN says:

ReturnedValue1

ReturnedValue2

However, I'm trying to get the output to look like:


MSN says:

ReturnedValue1

MSN says:

Processing ...

MSN says:

ReturnedValue2

Any help would be greatly appreciated.

Thanks,

Carl J




Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Carl J


Fixed.




Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Gruia Pitigoi-Aron - MSFT

Hi,

Would you mind posting how you fixed the issue so that others can take a look if they run into the same issue

Thank you!

Gruia






Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Carl J

I ended up using two SetOnDelays, the first one to return a response to the user right away (set the time to 0), and the second one was used if it was taking too long to receive a response from the second datasource

Code Snippet

procedure CallSecondWebService(INPUT)

MSG = "Processing ..."

touch datasource DoSomethingElse

call SetOnDelayMessage(5, MSG)

OBJ <= DoSomethingElse(INPUT)
- OBJ.ReturnedValue2

procedure CallFirstWebService(VARIABLE)

touch datasource DoSomething

OBJ <= DoSomething(VARIABLE)

//- OBJ.ReturnedValue1

call SetOnDelayMessage(0, OBJ.ReturnedValue1)

call CallSecondWebService(OBJ.ReturnedValue1)





Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Riaanvs

Hi
Would you mind sharing the source of your SetOnDelayMessage here Or is that a Buddyscript function
Cheers
Riaan






Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Carl J

Hey Riaan, how's it going

SetOnDelay() is a new method in Buddyscript 4.2 (or maybe it's 4.1.x), that displays a message when there is a slow query.

SetOnDelay(n, msg) displays the msg after n seconds.

call SetOnDelayMessage(5, MSG)

OBJ <= DoSomethingElse(INPUT)

If DoSomethingElse() doesn't return something within 5 seconds, then the MSG is given to the user.

Are you going to this year's WLA thing in England





Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Riaanvs

Cool thanks
Yeah I must be still on the previous one.
Any chance you can look at the source (right-click and definition)
Yes I'll be at the event...you 2
Cheers

Riaan






Re: Problems with call consecutive datasources (and SetOnDelayMessage)

Carl J

Look at the source Can that be done withing the Colloquis IDE

I won't be there, we're sending some one else this time Sad