There are certain scenarios where a running process will need to wait for input or a trigger from an external system or process. One can always create a polling mechanism in the process, but that adds unnecessary overhead and is not a real-time trigger; if the external call comes back a second after the polling mechanism checked for updates, the process will need to wait another full cycle before processing is initiated. Example scenarios include waiting for an external system to complete batched or nightly jobs, long running transactions potentially involving multiple line of business systems or even something simple as a human completing a task in an external system.
To cater for scenarios like these, the K2 platform has the concept of an asynchronous event, where pretty much any SmartObject call can be configured to wait for an external call before proceeding to the next step. The advantages of taking this approach are:
There are a couple of moving parts that need to be set up and to keep things easy to follow, the topic will be covered in two posts. For the first post, I will create the core settings and SmartObjects needed for a typical scenario. In the second post, I will cover an actual use case, making use of the artifacts created in this post.
The following components play a part in a typical asynchronous process:
Coverage of the K2 Workflow REST API is outside the scope of this post, it is documented in detail here:
K2 Workflow REST API
For this topic, the expectation is that the end point has been configured.
To ensure that the process waits for the external call to complete, expand the Options section at the bottom and check the Wait for external system checkbox:
And that’s all that necessary to get a process to wait for external responses. In the next installment, I will take this a little further where we can get use a K2 Smartform to perform this task for us.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.