Asynchronous Server Events provide a mechanism for "pausing" a workflow and wait for an external application to programmatically finish the server event before the workflow resumes. They behave similarly to client events, the difference being that asynchronous server events expect "machine" input from an external system or application, whereas a client event expects "user" input by one or more destination users.
Consider an example where a workflow will call an external organization to place an order. That external organization may take hours or days to complete the order request and send back confirmation. It would be inefficient to poll the external system for all that time and waiting for an automatic response would likely result in a time out. BY using the Asynchronous server event, you can essentially complete the event but the workflow will not continue until the external system has opened the server item and completed it, allowing your workflow to continue.
There are three parts to implementing an asynchronous server event:
1. In a workflow, use a default server event and set the event to execute asynchronously:
2. In the server event code, pass the serial number through to the other system. The external system will need to use this serial number to complete the server task - think of this as a "correlation id" which will allow the external system to find and complete the specific workflow task instance assigned to it.
3. When the other system is ready to finish the task, use the workflow client API to write code that calls the OpenServerItem() method, passing in the serial number that was sent in step 2.
For security purposes, the account that is executing the OpenServerItem() method requires the Server Event permission on the workflow definition, as shown below:
| Video | Links | Learn | Support |
|
No videos found for this article K2 on YouTube
No Additional links found for this article
No self-learning content for this article Try some scenarios...
No relevant support links available for this article
|
|||