<div dir="ltr">im getting the following error on doing that<div><br></div><div><div>Exception in thread &quot;pool-2-thread-1&quot; Exception executing consequence for rule &quot;size&quot; in <a href="http://com.net">com.net</a>: java.lang.NullPointerException</div>
</div><div><br></div><div>what might be the problem?</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 10, 2014 at 4:16 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@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">Seeing that the list is static you can use the usual way for accessing<br>
a static class member:<br>
<br>
    Event.listOfEvent.add( ... );<br>
<br>
@Mauricio: It&#39;s not unusual to maintain a static collection (even<br>
though there may be better ways, esp. with Drools).<br>
<div><div class="h5"><br>
<br>
<br>
On 10/03/2014, Mauricio Salatino &lt;<a href="mailto:salaboy@gmail.com">salaboy@gmail.com</a>&gt; wrote:<br>
&gt; Can you please elaborate about why do you want to do that? what&#39;s the point<br>
&gt; of having a list inside of the Event class that will contain the same<br>
&gt; event?<br>
&gt;<br>
&gt; The &quot;Then&quot; side of the rule is pure java.. so you just do<br>
&gt; event.getEvents().add(event);<br>
&gt;<br>
&gt; but I don&#39;t see the point of doing that.<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Mar 10, 2014 at 10:31 AM, Sandhya Sree<br>
&gt; &lt;<a href="mailto:sandhyachinnaraj@gmail.com">sandhyachinnaraj@gmail.com</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt; hi ,<br>
&gt;&gt;<br>
&gt;&gt; i have a class called Event which is as follows:<br>
&gt;&gt;<br>
&gt;&gt; public class Event {<br>
&gt;&gt;  private  String name;<br>
&gt;&gt;  private  File source;<br>
&gt;&gt;  private  Date timeStamp;<br>
&gt;&gt; public static List&lt;Event&gt; listOfEvents;<br>
&gt;&gt;<br>
&gt;&gt; public Event(String name, File source, Date timeStamp) {<br>
&gt;&gt;  <a href="http://this.name" target="_blank">this.name</a> = name;<br>
&gt;&gt; this.source = source;<br>
&gt;&gt; this.timeStamp = timeStamp;<br>
&gt;&gt;  }<br>
&gt;&gt;  public String getName() {<br>
&gt;&gt;  return name;<br>
&gt;&gt; }<br>
&gt;&gt; public void setName(String name) {<br>
&gt;&gt;  <a href="http://this.name" target="_blank">this.name</a> = name;<br>
&gt;&gt; }<br>
&gt;&gt; public File getSource() {<br>
&gt;&gt;  return source;<br>
&gt;&gt; }<br>
&gt;&gt; public void setSource(File source) {<br>
&gt;&gt;  this.source = source;<br>
&gt;&gt; }<br>
&gt;&gt; public Date getTimeStamp() {<br>
&gt;&gt;  return timeStamp;<br>
&gt;&gt; }<br>
&gt;&gt; public void setTimeStamp(Date timeStamp) {<br>
&gt;&gt;  this.timeStamp = timeStamp;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;  public void display()<br>
&gt;&gt;  {<br>
&gt;&gt;  System.out.println(name +&quot; &quot; + &quot;in folder: &quot; + source + &quot; on &quot; +<br>
&gt;&gt; timeStamp );<br>
&gt;&gt;   }<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; there are also some other classes associated with my project.. i have a<br>
&gt;&gt; rules file which computes the size of a folder and creates an object of<br>
&gt;&gt; Event class. every time this object of Event class is created i wwant to<br>
&gt;&gt; put it in a List&lt;Event&gt;.. how can i do this..<br>
&gt;&gt;<br>
&gt;&gt; my rules is as follows:<br>
&gt;&gt;<br>
&gt;&gt; rule &quot;size&quot;<br>
&gt;&gt; when<br>
&gt;&gt;   $p:  RuleContext($size: getOldContext().getParent().getUsableSpace() &gt;<br>
&gt;&gt; (30*1024*1024))<br>
&gt;&gt;<br>
&gt;&gt; then<br>
&gt;&gt;    Event event = new Event(&quot;folder almost full&quot;,<br>
&gt;&gt; $p.getOldContext().getParent(), new Date());<br>
&gt;&gt;    event.display();<br>
&gt;&gt;    ......here i want to put this event into the List&lt;Event&gt; declared in<br>
&gt;&gt; Event Class.....<br>
&gt;&gt;<br>
&gt;&gt;   end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; thanks,<br>
&gt;&gt; Sandhya<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
</div></div>&gt;  - MyJourney @ <a href="http://salaboy.com" target="_blank">http://salaboy.com</a> &lt;<a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a>&gt;<br>
<div class="im HOEnZb">&gt;  - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>
&gt;  - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
&gt;<br>
&gt;  - Salatino &quot;Salaboy&quot; Mauricio -<br>
&gt;<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<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></div>