Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Asynchronous http calls in a script based calculated value?

Hello good afternoon!

Is it possible to do http asynchronous calls to a OSLC service in RTC within a calculated value script?

Not by using the "com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters" in a value set, but for example with the http client: jazz.client.xhrGet(request).

RTC Version 5.0.2

Thank you!

0 votes

Comments

I see in the other post that you can do synchronous request already. Why asynchronous then? Your code logic in the calculated value script has to be in sequence, and an asynchronous request in the middle does not make sense.

Hello Donald, thanks for your comment!

In all server extensions involving java script I use asynchronous calls. This allows to continue the flow of the script, as you comment, an receive the results later when they are ready, without the script blocked, waiting for the return of the HTTP call.

If the request takes long in responding, with a synchronous call the screen freezes until the return is received.

I wonder if I can use "dojo.hitch" mechanism, like in the server java script extensions, so that the value of the attribute is filled once the service returned the value, but without blocking the user interface in a meantime.

the problem is what do you do about the value you didn't return from the main script invocation?  that design EXPECTS a value immediately.. and it blocks the UI til it GETS the value..

so you cannot make it 'not return' but be asynch at the same time.

now if the call to the script said 'post the value here when you get it'
and async secondary scrpt might work..  but it doesn't it is looking for the script return value.


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: Mar 10 '16, 8:48 a.m.

Question was seen: 1,483 times

Last updated: Mar 18 '16, 9:35 a.m.

Confirmation Cancel Confirm