Asynchronous Versus Synchronous Processing

 

With the recent versions, XperiDo moved to an Asynchronous processing mechanism for generating documents from their previous synchronous processing system to enhance system performance and to make the system more robust.

Usually with the synchronous method, calls made to XperiDo via Dynamics CRM workflows are executed off of a single thread within XperiDo and the response is returned back straightaway. This is time consuming and not robust. With the asynchronous model, calls made to XperiDo from Dynamics CRM are queued and they are then processed using multiple threads. Once the processing is done a callback is made back to Dynamics CRM from XperiDo with the generated document and perform the function that you configured in your workflow such as Create a Note or Send an Email.

Lately, a project that I was architecting required the processing to be done synchronously. After speaking with XperiDo support, the below method was introduced to us which worked very well. By default, when the XperiDo server is installed, the processing settings are automatically set for asynchronous processing. The requirement we had to fulfill required the document and its path (including file name) to be retrieved straightaway in the same workflow/dialog/action session without having to create a note or send an email using the XperiDo queue manager. This meant that whenever the CRM workflow or the dialog is invoked, we had to generate the document and retrieve the contents and display the URL back to the user after performing other business logic.

If you have a similar requirement, you can use the below technique to put the XperiDo on synchronous mode so that each call made from Dynamics CRM to XperiDo is processed within the same web service request and aren’t queued.

Step 1: Open XBi Integrator Administrator Console.

administrator console

Step 2: Expand “XperiDo” and then navigate to the role, variables and finally the CRM project.

Step 3: Expand “Flags” and find a flag with the name “_Timeout”

expand flags

Step 4: Change the timeout value from {ui:50,wf:0} to {ui:50,wf:120}.

Step 5: Save the settings and reload the project settings from the root.

Step 6: Restart XperiDo server.

Step 5: Upgrade CRM Solutions provided by XperiDo support with a hotfix that is required to fix a bug in the XperiDo CRM workflow activities with regards to synchronous processing. If you have already got the latest version, this bug may already be addressed. But if you are not receiving the “document URL” back from the XperiDo workflow activities after making a synchronous call, then this hotfix is required.

You might wonder why move to a synchronous patter while the asynchronous method is the recommended and it’s the default way of processing documents.

The use case that we were working towards had a requirement where a page in Adx Portal is required to generate a document and start downloading straight away when the user performs an action. With the asynchronous processing pattern (and at the time of writing this blog) this was not possible. So we employed a few things along with the XperiDo’s synchronous processing method and the architecture looked a bit like the one depicted below;

synchronous processing method

Hope you found this article useful, especially if you are using XperiDo On-Premise version for Dynamics CRM and requires a different way of processing documents. Stay tuned for more tips and tricks with XperiDo.