Tuesday, June 16, 2020

#780 OIC --> Netsuite Asynchronous Request Processing



Another feature supported by the OIC Netsuite adapter -

With asynchronous requests, your client application sends a request to SOAP web services, where it is placed in a processing queue and handled asynchronously with other requests. Your client application does not wait for a response but goes on to other work. After a job is submitted, a job Id is returned in the SOAP web services response. Your client application can then check on the status and result of the request by referencing the job Id.

Asynchronous processing may be advantageous in the following situations:
- If you expect your connection to NetSuite to be slow or unstable.
- If your job is large, and its processing can be postponed until off-peak hours.
Be aware that asynchronous responses may not be returned immediately. Before committing to using
asynchronous operations, you should consider this factor and decide whether it fits in with your business logic.

Above description taken from the Netsuite Web Services doc here

Here is a very simple example of leveraging this feature, when creating a new customer.

This is the synchronous version of such an integration, now to change this to asynchronous -








Step 1 - Add an Assign Activity to create the following 2 variables.
They will be used later on.


Step 2 - Create a WHILE loop


















Step 3 - Add the Netsuite Invoke to Create Customer


Configure as follows -



















Map as follows - note - I only map jobId and companyName


Step 4 - Add an Assign Action after the Netsuite Invoke -

Here we set the JobId and StatusValue values to the response from Netsuite -



Step 5 - Add a SWITCH Action 

Here we check the value of StatusValue

IF Completed, I then check which flavour - done in the SCOPE - 
ProcessResult.


In the SCOPE, I set the response, based on the outcome.

IF NOT Completed - the Otherwise path is empty - 
but I could do some other processing, if my use case required such. 
I could also add a WAIT.


Activate and Test -


Check out the OIC Tracking page for this instance -

One can follow the async request processing in the Activity Stream -










No comments: