[rules-users] Accumulate function
Matteo Cusmai
cusmaimatteo at gmail.com
Tue May 22 06:33:16 EDT 2012
Hi all,
i am going to use a custom accumulate function like that:
rule "CrowdInAreaEvent-event"
no-loop
when
$RFIDReader : SensorFixed(type == Sensor.SENSOR_TYPE_RFID,
$coverageArea : areaOfInterest )
not CrowdInAreaEvent( sensor == $RFIDReader, this meets[ 5s ] $obs )
$count : Integer( intValue > 10 )
from accumulate( $obs : RFIDObservation( $tagid : tagid, sensor
== $RFIDReader )
over window:time( 60s ) from entry-point lowLevelSensorStream,
countDistinct( $tagid ) );
then
insert( SituationManager.createCrowdInAreaEvent( "Crowd, number
people: " + $count, Event.THREAT_LOW, $coverageArea, $RFIDReader, $count,
60, 10 ) );
end
I need to refer $obs object in order to compare timing of new observation
with last event. Is it possible to do that?
Thanks a lot,
Matteo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120522/be4888d7/attachment.html
More information about the rules-users
mailing list