From 8c0869649abe5b2eb1a4edde3a826f9d1d956c6f Mon Sep 17 00:00:00 2001 From: charitha Date: Fri, 10 Aug 2018 19:37:05 +0530 Subject: [PATCH] Update alert messages to convey proper meaning --- .../resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql | 4 ++-- .../resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql | 4 ++-- .../alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql | 2 +- .../resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql index 982cb09cb3..1e72dd1d4b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql @@ -21,7 +21,7 @@ select id, owner, latitude, longitude, timeStamp, type, speed, heading, eventId, insert into withinStream; from withinStream[isWithin == false] -select id, owner, latitude, longitude,timeStamp, type, speed, heading, "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id), " is outside $areaName area!!!") as information, true as notify +select id, owner, latitude, longitude,timeStamp, type, speed, heading, "ALERTED" as state, str:concat("The ", type, " device `", id, "` of $owner is outside $areaName area!") as information, true as notify insert into dataOut; from withinStream[isWithin == true] @@ -33,5 +33,5 @@ select fs2.id, fs2.owner, fs2.latitude, fs2.longitude, fs2.timeStamp, fs2.type, insert into crossedStream; from crossedStream[isWithin == false] -select id, owner, "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id), " is outside $areaName area!!!") as information, timeStamp, latitude, longitude, type +select id, owner, "ALERTED" as state, str:concat("The ", type, " device `", id, "` of $owner is outside $areaName area!") as information, timeStamp, latitude, longitude, type insert into alertsOut; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql index 022d915220..2309f64df3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql @@ -16,11 +16,11 @@ define stream dataOut (id string, owner string, latitude double, longitude doubl define stream alertsOut (id string, owner string, state string, information string, timeStamp long, latitude double, longitude double, type string); from dataIn[speed >= $speedAlertValue and id == "$deviceId" and owner == "$owner"] -select id, owner, latitude, longitude, timeStamp, type, speed, heading, "ALERTED" as state, str:concat(str:concat(str:concat(str:concat("Speed of ",type), " device "), id), " is not normal!!") as information, true as notify +select id, owner, latitude, longitude, timeStamp, type, speed, heading, "ALERTED" as state, str:concat("The ", type, " device `", id, "` of $owner is traveling at ", math:round(speed), "km/h and is exceeding the $speedAlertValuekm/h speed limit") as information, true as notify insert into dataOut; from dataIn[speed < $speedAlertValue and id == "$deviceId" and owner == "$owner"] -select id, owner, latitude, longitude, timeStamp, type, speed, heading, "NORMAL" as state, str:concat(str:concat(str:concat(str:concat("Speed of ",type), " device "), id), " is normal") as information, false as notify +select id, owner, latitude, longitude, timeStamp, type, speed, heading, "NORMAL" as state, str:concat("The ", type, " device `", id, "` of $owner is travailing at normal speed.") as information, false as notify insert into dataOut; from dataOut[notify == true] diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql index 00673bb203..4d8ef13577 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Stationery_alert.siddhiql @@ -83,7 +83,7 @@ select id, owner, latitude, longitude,timeStamp, type, speed, heading ,eventId , insert into dataOutStream; from dataOutStream[isStationary == 'true'] -select id, owner, latitude, longitude,timeStamp, type, speed, heading, "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id),"is in $stationeryName area!!!") as information, true as notify +select id, owner, latitude, longitude,timeStamp, type, speed, heading, "ALERTED" as state, str:concat("The ", type, " device `", id, "` of $owner is in $stationeryName area!") as information, true as notify insert into dataOut; from dataOutStream[isStationary == 'false'] diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql index 2ce27e7f3b..5a704f046e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql @@ -21,7 +21,7 @@ select id, owner, latitude, longitude, timeStamp, type, speed, heading, eventId, insert into withinStream; from withinStream[isWithin == true] -select id, owner, latitude, longitude,timeStamp, type, speed, heading, "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id), " is in $areaName restricted area!!!") as information, true as notify +select id, owner, latitude, longitude,timeStamp, type, speed, heading, "ALERTED" as state, str:concat("The ", type, " device `", id, "` of $owner is inside $areaName area!") as information, true as notify insert into dataOut; from withinStream[isWithin == false] @@ -33,5 +33,5 @@ select fs2.id, fs2.owner, fs2.latitude, fs2.longitude, fs2.timeStamp, fs2.type, insert into crossedStream; from crossedStream[isWithin == true] -select id, owner, "ALERTED" as state, str:concat(str:concat(str:concat(type," device "),id), " is outside $areaName area!!!") as information, timeStamp, latitude, longitude, type +select id, owner, "ALERTED" as state, str:concat("The ", type, " device `", id, "` of $owner is inside $areaName area!") as information, timeStamp, latitude, longitude, type insert into alertsOut;