Most building mediator does not support alarms correlation and for generating alarms if the certain condition remain true over time. This can easily achieved by using Drool Complex Event capabilities.
Check this simple rule, which is If DG set fails to start even after five minutes (In actual this will be combined with some other condition as well)
This rule can be fired on a JSM Queue on which device data is being posted and a stateful session is being maintained.
rule "Generate Alarm"
when
$devpoint: PointValueEvent ( locationId == 11 && deviceTypeId == 16 )
from entry-point DevicePointStream
PointNameValue ( controlParameter == 'FailToStart' && value ==1) from $devpoint.points
$devpoint1: PointValueEvent ( locationId ==$devpoint.locationId && deviceTypeId ==$devpoint.deviceTypeId , this after[5m,*] $devpoint ) from entry-point DevicePointStream
PointNameValue ( controlParameter == 'FailToStart' && value ==1) from $devpoint1.points
then
alarm(kcontext, $devpoint);
retract($devpoint);
retract($devpoint1);
end
Check this simple rule, which is If DG set fails to start even after five minutes (In actual this will be combined with some other condition as well)
This rule can be fired on a JSM Queue on which device data is being posted and a stateful session is being maintained.
rule "Generate Alarm"
when
$devpoint: PointValueEvent ( locationId == 11 && deviceTypeId == 16 )
from entry-point DevicePointStream
PointNameValue ( controlParameter == 'FailToStart' && value ==1) from $devpoint.points
$devpoint1: PointValueEvent ( locationId ==$devpoint.locationId && deviceTypeId ==$devpoint.deviceTypeId , this after[5m,*] $devpoint ) from entry-point DevicePointStream
PointNameValue ( controlParameter == 'FailToStart' && value ==1) from $devpoint1.points
then
alarm(kcontext, $devpoint);
retract($devpoint);
retract($devpoint1);
end
No comments:
Post a Comment