Does ui designer external api call returns a promise ?

1
0
-1

Hi,

Im very new to bonitasoft.

I need to know wheather the api call from ui designer forms returns a promise ?
my scenario is that i have a custom widget for bootstrap alerts and i need to get the alert messge from the api call from business data model. And give the message as a property to the custom widget. The messge is undefined as the custom widget is not waiting untill the api call is complete and data is fetched back.

Any suggestion would be a great help :)

1 answer

1
0
-1
This one is the BEST answer!

I would suggest that the situation is Not Today.

And I think it would be a significant rewrite to make it Promissory as you would need to do this for every call from the UI. Something that Bonitasoft may consider but you'll have to add it to the Ideas forum.

It might be possible to create a Custom REST call that implements the Java CompletableFuture which can be used to implement Promise. However will it work the way you want it to, I have no idea, try it and see :)

See here for details.

regards
Seán

PS: While you may not like the answer, it gives a possible solution, please mark as resolved.

Comments

Submitted by Abin.Xavier on Fri, 03/24/2017 - 06:55

Thanks for the response.
The widget provided by bonita doesnt have this problem... The data is not undefined when you use a table widget and get data from api call. Can anyone help me where i should dig in to get an idea of what bonita has done for this.

Submitted by Sean McP on Fri, 03/24/2017 - 07:08

If you are using BDM then there is a high likely hood that the data will always be there, Bonitasoft simply doesn't exist without BDM...

So it's implicitly promised that you will never get an undefined, no data sure, but not undefined...

regards

Submitted by Abin.Xavier on Fri, 03/24/2017 - 07:15

Thats right Sean, Data is availabe. what i was trying to say is that, before the data is fetched using external api the custom widget is rendered. Thats not the issue with regular widgets as far as i assume, please correct me as i only a beginner level :)

Notifications