Hi Vincent,<br>i have an rfid reader and i am collecting tagid from that sensor.<br>I would like to raise an event when the number of different tags in a time interval is greater than 20 (for example).<br><br><br><br><div class="gmail_quote">
On Tue, May 22, 2012 at 2:33 PM, Vincent LEGENDRE <span dir="ltr">&lt;<a href="mailto:vincent.legendre@eurodecision.com" target="_blank">vincent.legendre@eurodecision.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:Times New Roman">No.<br>You can&#39;t use $obs before you bind it (2nd pattern)<br>The binding done for accumulate pattern must be used in some accumulate fonction in order to be seen outside.<br>
<br>Instead of trying to fix your rule, may be you can describe (with simple phrases) what you are trying to do ?<br><br><hr><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal">
<b>De: </b>&quot;Matteo Cusmai&quot; &lt;<a href="mailto:cusmaimatteo@gmail.com" target="_blank">cusmaimatteo@gmail.com</a>&gt;<br><b>À: </b>&quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<br>
<b>Envoyé: </b>Mardi 22 Mai 2012 12:33:16<br><b>Objet: </b>[rules-users] Accumulate function<div><div class="h5"><br><br>Hi all,<br>i am going to use a custom accumulate function like that:<br><br>rule &quot;CrowdInAreaEvent-event&quot;<br>
    no-loop<br>    when<br>        $RFIDReader : SensorFixed(type == Sensor.SENSOR_TYPE_RFID, $coverageArea : areaOfInterest )<br>
        not CrowdInAreaEvent( sensor == $RFIDReader, this meets[ 5s ] $obs )<br>        $count : Integer( intValue &gt; 10 ) <br>            from accumulate(<span style="color:rgb(255,0,0)"> $obs : </span>RFIDObservation( $tagid : tagid, sensor == $RFIDReader ) <br>

            over window:time( 60s ) from entry-point lowLevelSensorStream, countDistinct( $tagid ) );<br>    then<br>        insert( SituationManager.createCrowdInAreaEvent( &quot;Crowd, number people: &quot; + $count, Event.THREAT_LOW, $coverageArea, $RFIDReader, $count, 60, 10 ) );<br>

end<br><br>I need to refer $obs object in order to compare timing of new observation with last event. Is it possible to do that?<br><br>Thanks a lot,<br>Matteo.<br>
<br></div></div>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div><br></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>