Developing Apama Applications > Developing Apama Applications in EPL > Making Application Data Available to Clients > Creating DataView definitions > Example
Example
Here is an example of creating a DataView definition and handling DataViewException events:
using com.apama.dataview.DataViewAddDefinition;
using com.apama.dataview.DataViewException;
...
DataViewAddDefinition add := new DataViewAddDefinition;
add.dvName := "Weather";
add.dvDisplayName := "Weather";
add.fieldNames := ["location","temperature","humidity","visibility"];
add.fieldTypes := ["string","integer","integer","integer"];
add.keyFields := ["location"];
route add;
DataViewException dvException;
on all DataViewException(): dvException {
log "*** Weather monitor error: " +
   dvException.toString() at ERROR;
}
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.