<div dir="ltr">What field do you set in the constructor then?<div><br></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">new Event(&quot;folder almost full&quot;,<b> $p.getOldContext().getParent()</b></span><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">, new Date());</span><br>
</div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">Whatever field this is you should check in the LHS with the &quot;not Event(....)&quot; - this ensures the rule only activates if there isn&#39;t an Event already for the RuleContext.</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 17 March 2014 09:41, 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">no...Event doesnot have context field </div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Mar 17, 2014 at 3:07 PM, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@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"><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><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><div style="font-size:13px;font-family:arial,sans-serif"><b> not Event( context == $p.getOldContext().getParent());</b></div><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><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>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>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><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></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></blockquote></div><br></div>
<br>_______________________________________________<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></blockquote></div><br></div>
</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>