Apama 10.15.0 | Developing Apama Applications | Developing Apama Applications in EPL | Making Application Data Available to Clients | Deleting DataView items
 
Deleting DataView items
Use the following event types to delete DataView items.
DataViewDeleteItem
Create and route an event of this type to delete a DataView item. A response is provided by a DataViewItemDeleted, DataViewException or DataViewItemException event.
Here is an example that creates and routes a DataViewDeleteItem event and handles the DataViewItemDeleted response by logging the deletion of the item:
using com.apama.dataview.DataViewDeleteItem;
using com.apama.dataview.DataViewItemDeleted;
string location;
...
DataViewDeleteItem delete := new DataViewDeleteItem;
delete.dvName := "Weather";
delete.dvItemId := -1; // Set the ID to -1 when using keyFields
delete.keyFields := [location];
route delete;
on DataViewItemDeleted (dvName="Weather") as deleted {
   log("Weather monitor - DataViewItemDeleted:
      "+deleted.dvItemId.toString());
}
DataViewItemDeleted
These events are responses to DataViewDeleteItem events. They indicate the successful deletion of a DataView item.
DataViewDeleteAllItems
Create and route an event of this type to delete all DataView items associated with a specified DataView definition. A response is provided by a DataViewAllItemsDeleted, DataViewException or DataViewItemException event.
DataViewAllItemsDeleted
These events are responses to DataViewDeleteAllItem events. They indicate the successful deletion of all items associated with a given DataView definition.