As part of the Relativity Services API (RSAPI) Deprecation, content on this page referring to the RSAPI and the Patient Tracker application is in the process of being deprecated and will no longer be supported. For more information and alternative APIs, see RSAPI deprecation process.

Asynchronous framework

The asynchronous framework is used to monitor long-running operations by returning status updates as events. Not only does the asynchronous framework provide you with ability to monitor these operations, but you can also use it to cancel them. The asynchronous framework supports the following processes:

  • Creating BatchSets using the CreateBatchesforBatchSet() method
  • Purging BatchSets using the PurgeBatchesOfBatchSet() method

After the asynchronous version of these operations starts a process and succeeds, it returns a unique identifier for that operation. The property is empty when the operation fails. Each of these operations (CreateBatchesforBatchSet() and PurgeBatchesOfBatchSet() methods) has two versions: one that registers by default and one that takes a flag. Depending on the version of the operation, the proxy is registered to monitor the state of the process, and to raise events as its status changes. You can call the MonitorProcessState() method to explicitly register the proxy to monitor and raise status events for a running process. For code samples, see BatchSet.

The asynchronous framework will raise events for status updates automatically. However, you can also retrieve the process status explicitly by calling the GetProcessState() method on the proxy. This method returns a ProcessInformation object that contains data about the internal state of the process.

You can cancel an asynchronous process or allow it to run until it completes or fails. To perform this action, call the FlagForCancellation() method, which flags the process for cancellation when the current batch completes.