@ -3,7 +3,10 @@
@Plan:description('ExecutionPlan')
@Plan:description('ExecutionPlan')
@Import('org.wso2.iot.android.sense:1.0.0')
@Import('org.wso2.iot.android.sense:1.0.0')
define stream AndroidSense (meta_owner string, meta_deviceId string, meta_type string, meta_timestamp long, battery int, battery_state string, battery_status string, battery_temperature int, gps_lat double, gps_long double, accelerometer_x float, accelerometer_y float, accelerometer_z float, speed_limit float, turn_way string, magnetic_x float, magnetic_y float, magnetic_z float, gyroscope_x float, gyroscope_y float, gyroscope_z float, light float, pressure float, proximity float, gravity_x float, gravity_y float, gravity_z float, rotation_x float, rotation_y float, rotation_z float, word string, word_sessionId string, word_status string, beacon_major int, beacon_minor int, beacon_proximity string, beacon_uuid int, call_number string, call_type string, call_start_time long, call_end_time long, screen_state string, audio_playing bool, headset_on bool, music_volume int, activity_type int, confidence int, sms_number string, application_name string, action string);
define stream AndroidSense (meta_owner string, meta_deviceId string, meta_type string, meta_timestamp long, battery int, battery_state string, battery_status string, battery_temperature int, gps_lat double, gps_long double, accelerometer_x float, accelerometer_y float, accelerometer_z float, speed_limit float, turn_way string, magnetic_x float, magnetic_y float, magnetic_z float, gyroscope_x float, gyroscope_y float, gyroscope_z float, light float, pressure float, proximity float, gravity_x float, gravity_y float, gravity_z float, rotation_x float, rotation_y float, rotation_z float, word string, word_sessionId string, word_status string, beacon_major int, beacon_minor int, beacon_proximity string, beacon_uuid int, call_number string, call_type string, call_start_time long, call_end_time long, screen_state string, audio_playing bool, headset_on bool, music_volume int, activity_type int, confidence int, sms_number string, application_name string, action string, data_type string, data_sent long, data_received long);
@Export('org.wso2.iot.android.data:1.0.0')
define stream DataStream (meta_owner string, meta_deviceId string, meta_timestamp long, type string, received long, sent long);
@Export('org.wso2.iot.android.activity:1.0.0')
@Export('org.wso2.iot.android.activity:1.0.0')
define stream ActivityStream (meta_owner string, meta_deviceId string, meta_timestamp long, action string);
define stream ActivityStream (meta_owner string, meta_deviceId string, meta_timestamp long, action string);
@ -26,8 +29,6 @@ define stream BatteryStream (meta_owner string, meta_deviceId string, meta_times
@Export('org.wso2.iot.android.sms:1.0.0')
@Export('org.wso2.iot.android.sms:1.0.0')
define stream SmsStream (meta_owner string, meta_deviceId string, meta_timestamp long, number string, type string, body string);
define stream SmsStream (meta_owner string, meta_deviceId string, meta_timestamp long, number string, type string, body string);
@Export('org.wso2.geo.LocationStream:1.0.0')
define stream geoLocationStream (id string, timeStamp long, latitude double, longitude double, type string, speed float, heading float);
from AndroidSense[meta_type == 'sms']
from AndroidSense[meta_type == 'sms']
select meta_owner, meta_deviceId, meta_timestamp, sms_number as number, action as type, "" as body
select meta_owner, meta_deviceId, meta_timestamp, sms_number as number, action as type, "" as body
@ -41,7 +42,7 @@ from AndroidSense[meta_type == 'audio']
select meta_owner, meta_deviceId, meta_timestamp, audio_playing, headset_on, music_volume
select meta_owner, meta_deviceId, meta_timestamp, audio_playing, headset_on, music_volume
insert into AudioStream;
insert into AudioStream;
from AndroidSense[meta_type == 'gps ']
from AndroidSense[meta_type == 'location ']
select meta_owner, meta_deviceId, meta_timestamp, gps_lat as latitude, gps_long as longitude
select meta_owner, meta_deviceId, meta_timestamp, gps_lat as latitude, gps_long as longitude
insert into LocationStream;
insert into LocationStream;
@ -57,6 +58,6 @@ from AndroidSense[meta_type == 'activity']
select meta_owner, meta_deviceId, meta_timestamp, action
select meta_owner, meta_deviceId, meta_timestamp, action
insert into ActivityStream;
insert into ActivityStream;
from AndroidSense[meta_type == 'gps ']
from AndroidSense[meta_type == 'data ']
select meta_deviceId as id, meta_timestamp as timeStamp, gps_lat as latitude, gps_long as longitude, "android_sense" as type, speed_limit as speed, 0.0f as heading
select meta_owner, meta_deviceId, meta_timestamp, data_type as type, data_received as received, data_sent as sent
insert into geoLocation Stream;
insert into Data Stream;