Now that I see this code I wonder why you don&#39;t simply promote MyFact<br>to an event?<br><br>But, given the current situation, which removes MyEvent facts after 1m,<br>and assuming that you insert the MyEvent *before* its corresponding<br>
MyFact, you can<br><br>rule &quot;fact-without-event&quot;<br>when<br>    $f: MyFact($entity : entity)<br>    not MyEvent( entity == $entity )<br>then<br>   retract( $f );<br>end<br><br>and the obsolete MyFact will be gone, too.<br>
<br>-W<br><br><br><div class="gmail_quote">On 12 November 2010 11:02, Ayush <span dir="ltr">&lt;<a href="mailto:ayush.vatsyayan@alcatel-lucent.com">ayush.vatsyayan@alcatel-lucent.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks. Actually I did it in different way what I did is I declared my fact<br>
into drl file as declare MyFact and then I&#39;d added an @expires to it. It<br>
<div><div></div><div class="h5">works fine but now the problem is that for every fact inserted I&#39;d also<br>
inserted an event for it.<br>
<br>
Now as the drl file can be updated by user so say he&#39;d defined expiry time<br>
for events as 1m and for facts as 10s in this case since I&#39;m using sliding<br>
window for events and based on this event I&#39;m fetching the fact. So now I&#39;ll<br>
be getting the event but facts will not be available as the 2nd fact came<br>
after 20s hence the rule will not be fired. below is the sample rule.<br>
<br>
declare MyEvent<br>
        @role(event)<br>
        @expires( 1m )<br>
end<br>
<br>
declare MyFact<br>
        @expires( 10s )<br>
end<br>
rule &quot;MyCorrelation&quot;<br>
        no-loop true<br>
        dialect &quot;mvel&quot;<br>
        lock-on-active<br>
        when<br>
                $E1 : MyEvent( prop1 == 2, $entityA : entity ) over window:time(60s) from<br>
entry-point NotificationStream<br>
                $E2 : MyEvent( this != $E1, prop1 == 1, $entityB : entity ) over<br>
window:time(60s) from entry-point NotificationStream<br>
                $F2 : MyFact(this.entity == $entityB)<br>
                $F1 : MyFact(this.entity == $entityA)<br>
        then<br>
                System.out.println(&quot;I&#39;m executed successfully&quot;);<br>
end<br>
<br>
Now what I want is that I can define the @expires time at a single location<br>
or I can verify the logic of these rules?<br>
<br>
Also if say I&#39;d defined the @expires for event as 10s while in sliding<br>
window I&#39;m using over:time(1m) then also it is not same.<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-tp1875795p1887987.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Removing-facts-from-statefulknowledgeSession-s-memory-tp1875795p1887987.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br>