<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Assuming Event has a field called &quot;context&quot; (which is set by the constructor you use in your RHS):-</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">when</div><div style="font-family:arial,sans-serif;font-size:13px"> $p: RuleContext($size: getOldContext().getParent().getUsableSpace() &gt; (30*1024*1024))   </div>
<div style="font-size:13px;font-family:arial,sans-serif"><b> not Event( context == $p.getOldContext().getParent());</b></div><div style="font-family:arial,sans-serif;font-size:13px">then</div><div style="font-family:arial,sans-serif;font-size:13px">
   Event event = new Event(&quot;folder almost full&quot;, $p.getOldContext().getParent(), new Date());</div><div style="font-family:arial,sans-serif;font-size:13px">   event.display();</div><div style="font-family:arial,sans-serif;font-size:13px">
end</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 March 2014 09:25, Sandhya Sree <span dir="ltr">&lt;<a href="mailto:sandhyachinnaraj@gmail.com" target="_blank">sandhyachinnaraj@gmail.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 dir="ltr">hi,<div><br></div><div>i have the following rule file :</div><div><br></div><div><div>rule &quot;size&quot;</div>
<div><br></div><div>when</div><div> $p: RuleContext($size: getOldContext().getParent().getUsableSpace() &gt; (30*1024*1024))  </div>
<div>then</div><div>   Event event = new Event(&quot;folder almost full&quot;, $p.getOldContext().getParent(), new Date());</div><div>   event.display();</div><div>end</div></div><div><br></div><div><br></div><div>im loading this rule file and executing the rules once in 10 seconds in a continuous loop from my java class. assuming the when part is always true, the event object created gets displayed each and every time once in 10 seconds. i want to create the object only once with the fact that the event is already there.. i.e.  i dont want to create the object again if it is already created.. how can i do that?</div>

<div><br></div><div><br></div><div>Thanks.</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></blockquote></div><br></div>