Developing Apama Applications > Developing Apama Applications in EPL > Making Application Data Available to Clients > Creating DataView items > Example
Example
Here is an example that creates and routes a DataViewAddItem event, and handles the DataViewItem response by logging the addition of the item:
using com.apama.dataview.DataViewAddItem;
using com.apama.dataview.DataViewItem;
...
string location ;
integer temp;
integer humidity;
integer visibility;
...
DataViewAddItem item := new DataViewAddItem;
item.dvName := "Weather";
item.fieldValues :=
   [location,temp.toString(),humidity.toString(),
   visibility.toString()];
route item;
DataViewItem added;
on DataViewItem (dvName="Weather"):added {
   log("Weather monitor - DataViewItem: " +
      added.dvItemId.toString());
}
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.