This adapter is used to create a synchronous experience when executing a Kinetic Task process. This is accomplished using this adapter, a task process, and a datastore form.
High level overview
These are the steps of the synchronous process:
Client machine makes a bridge resource request of the Kinteic Task Sync adapter.
Configuration of the bridge and bridge models in Request and Bridgehub are required.
The adapter starts a task process.
The process that is started is passed to the adapter through the qualification mapping.
The adapter passes a Callback Id as an input to the process.
The task process writes a record to the kinetic-task-sync-log datastore form.
Task is responsible for populating the Callback Id field which is later used for lookup.
The adapter begins a polling process looking for a record with the Callback Id.
The polling process has a configurable timeout (default 5 seconds).
If the record is found the adapter will return its results.
If found the adpater will attempt to delete the record from the datastore.
There are three potential results from the adapter. The different results depended on whether the execution was a success, failure or there was a timeout. Which properties in the return object that get populated are dependent on the result of the execution.
Not Empty Return Properties
Status of Record
deleted (unless delete fails)
unknown (depends on failure)
The Task Processes Responsibility
The process must create a submission in the kinetic-task-sync-log datastore form.
The process must populate the provided callbackId to the Callback Id field on the datastore form.
If there are results of the process; they must be written to the Results field on the datastore form.
Features of the Adapter
On initialization of the adapter a check is made to see if kinetic-task-sync-log exists in the space.
If kinetic-task-sync-log does not exist then the adapter will create it.
A 5 second default timeout is provided, but can be overwritten in the Bridge Setup.
If the timeout is set to 0 the adapter will start a task process and return without polling.
A request to the adapter with just a callback id can be used to retrieve a record.
Once a record is found it will be returned and cleaned up (deleted from the datastore).