...
- On the Main tab, click Execution Plans.
- Click Add Execution Plan.
Copy the execution plan that is given below and replace the sample content that is in the text box.
Code Block @Plan:name('analze_battery_level') @Import('org.wso2.iot.DeviceInfoStream:1.0.0') define stream inputStream (meta_deviceId string, meta_deviceType string, timeStamp long, imei string, imsi string, deviceModel string, vendor string, osVersion string, osBuildDate string, batteryLevel double, totalInternalMemory double, availableInternalMemory double, totalExternalMemory double, availableExternalMemory double, operator string, connectionType string, mobileSignalStrength double, ssid string, cpuUsage double, totalRAM double, availableRAM double, pluggedIn bool); @Export('org.wso2.iot.BatteryStream:1.0.0') define stream outputStream (meta_deviceId string, meta_deviceType string, meta_timestamp long, level double, year int, month int, day int, hour int, minute int); from inputStream select meta_deviceId, meta_deviceType, timeStamp as meta_timestamp, batteryLevel as level, time:extract(time:timestampInMilliseconds(), 'year') as year, time:extract(time:timestampInMilliseconds(), 'day') as day, time:extract(time:timestampInMilliseconds(), 'hour') as hour, time:extract(time:timestampInMilliseconds(), 'minute') as minute insert into outputStream;
- Click Add Execution Plan.
Try it out
What's next
- Want to know more on the WSO2 IoT Server Siddhi extensions? See WSO2 IoT Server Siddhi Extensions.
Try out the tutorials listed below and see how the extensions described above are put into use.