Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in EPL | Making Application Data Available to Clients | Creating DataView definitions
 
Creating DataView definitions
Use the following event types to create DataView definitions.
DataViewAddDefinition
Create and route an event of this type in order to create a DataView definition. The response is provided by a DataViewDefinition or DataViewException event.
DataViewDefinition
These events are responses to DataViewAddDefinition events. They indicate the successful creation of a DataView definition. The contents of the fields are exactly those of the DataViewAddDefinition event to which this is a response, except possibly for extraParams.
DataViewException
These events occur under exceptional circumstances in response to DataViewAddDefinition or DataViewDeleteDefinition events, or any circumstance under which a DataView cannot be identified.
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;
on all DataViewException() as dvException {
log "*** Weather monitor error: " +
   dvException.toString() at ERROR;
}

Copyright © 2013-2018 | 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.