Improve service actions: force wait for result
180
Views
3
Comments
New
Service Studio

So, we like service actions, loosely coupled and stuff, but there is room for improvement.

As these are essentially web services that run in another thread, we frequently run into the situation that the result we want to use the result in an assign, that isn't there yet.

For situation like these I would like to have the extra option for a service action to 'wait for result'. With this option we could effectively get rid of the entire Server Actions methodology. 

Everything is an service action, but we can force to wait for the results and cleaner logic tabs.


Hi Joost,

I am not sure if I understand. Service Actions are not running as fire-and-forget, you call them and your flow continues when the service action completes and on completion the output parameters of the service action are available.

Are you confusing Service Action here with Client Action?

Regards,

Daniel

Hi Daniël,

I might be confusing them. From what I understand is dat service actions are essentially 'internal' web services. As a web service call runs in it's own thread. I was wondering how I be absolutely 100% sure that the webservice is ready running it's course. So, I thought I need this option. 

I've seen similar options on other platforms where I can choose to run a flow on the client of let the server process it ( because of speed advantages ( no round trips ). However, I might want to wait for the server to finish before continuing myself. Hence, the option 'wait for completion'.

Regards,

Joost

As a developer in terms of how to treat, a service action call is no different from a server action call, except for the fact that it is a distributed transaction. When you call the service action, OutSystems will wait in the current flow, execute the service action on another thread, and resuming the calling flow when the service action is finished, returning the output parameters. If the service action runs into an exception, your calling flow can handle the exception.

There is no option to wait or not to wait for the service action to finish in the platform, you will always wait.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Reuse_and_Refactor/Use_Services_to_Expose_Functionality