The NPE during insertion is highly suggestive of another problem. Even if there were two Event classes (one the pojo, the other one the declared one) there should not be a NPE; the &quot;hello world&quot; rule simply would not fire. Are all fields - especially eventName - properly initialized before that fact is inserted? <br>
<br>-W<br><br><div class="gmail_quote">2012/2/9 Joaquín Díaz Vélez <span dir="ltr">&lt;<a href="mailto:joaquin.diazvelez@fluxit.com.ar">joaquin.diazvelez@fluxit.com.ar</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi guys,</div><div><br></div><div>            we are currently working with Drools Fusion in order to build a complex event processing solution. We&#39;ve modelled our events using and object (Event) and this object is shared with everyone that needs to publish and event. </div>

<div><br></div><div>            Our scenario goes this way</div><div><br></div><div>1) Our shared class, located in <b>ar.com.fluxit.Event</b></div><div><br></div><div>2) An example of our cep rules declared in package <b>rules.flux</b></div>

<div><br></div><div>    package <b>rules.flux</b></div><div><div><br></div><div>    import <b>ar.com.fluxit.Event;</b></div><div><br></div><div>    declare <b>Event</b></div><div><span style="white-space:pre-wrap">        </span>@role (event)</div>

<div><span style="white-space:pre-wrap">        </span>@expires(1m)</div><div>    end</div><div><br></div><div><div>    rule &quot;hello world&quot;</div><div><span style="white-space:pre-wrap">        </span>when</div>
<div><span style="white-space:pre-wrap">                </span>    $event:Event( eventName == &quot;Hello World&quot;) from entry-point &quot;<b>rules.flux</b>&quot;</div><div><span style="white-space:pre-wrap">        </span>then</div>
<div><span style="white-space:pre-wrap">                </span>    System.out.println(&quot;Hello world&quot;);</div><div>        end</div></div><div><br></div><div><div><br></div></div><div>3) When we try to insert a <b>ar.com.fluxit.Event </b>as a fact in entry point &quot;rules.flux&quot; Drools Fusion throws a NullPointerException. If you read Drools Expert documentation (<a href="http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch05.html#d0e3661" target="_blank">http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch05.html#d0e3661</a> - </div>

<h3 style="color:rgb(74,93,117);line-height:20px;margin-top:0em;font-family:&#39;Lucida Grande&#39;,Geneva,Verdana,Arial,sans-serif;padding-top:0em;padding-bottom:0em;text-align:justify"><a><font style="font-weight:normal" size="2">Accessing Declared Types from the Application Code) you find this paragraph:</font></a></h3>

<div><a style="color:rgb(51,51,51);font-family:&#39;Lucida Grande&#39;,Geneva,Verdana,Arial,sans-serif;font-size:12px;line-height:18px;text-align:justify">&quot;The first important thing to realize is that a declared fact will belong to the package where it was declared. So, for instance, in the example below, <code style="font-size:0.9em;font-family:courrier,monospace;white-space:nowrap">Person</code> will belong to the <code style="font-size:0.9em;font-family:courrier,monospace;white-space:nowrap">org.drools.examples</code> package, and so the fully qualified name of the generated class will be <code style="font-size:0.9em;font-family:courrier,monospace;white-space:nowrap">org.drools.examples.Person</code>.&quot;</a></div>

<div><br></div><div>When we change package declaration to <b>package ar.com.fluxit </b>everything works like a charm. But in our cep scenario we need that our ar.com.fluxit.Event object to be user by all rules declared in any package. </div>

<div><br></div><div>So, there goes the question. There is a workaround for this? This is a bug? </div><div><br></div><div>Any help would be very appreciated</div><div><br></div><div><br></div><div>Cheers</div><span class="HOEnZb"><font color="#888888"><div>
<br clear="all">
<div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:medium;border-collapse:collapse"><div style="font-size:13px;margin-top:5px;margin-right:15px;margin-bottom:5px;margin-left:15px;padding-bottom:20px">

<div>Joaquín Díaz Vélez<br><br>Flux IT SA<br>Calle 9 N° 865 - Paseo La Panadería - Planta Alta<div>La Plata - Buenos Aires - Argentina<br></div>Teléfono (+54) <span style="font-family:arial;font-size:small;border-collapse:separate">221 553 2980</span> int 306</div>

<div><div>Móvil <a href="tel:%28%2B54%29%209221%205863322" value="+5492215863322" target="_blank">(+54) 9221 5863322</a></div></div></div></span><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">    <a href="http://www.fluxit.com.ar" style="color:rgb(42,93,176)" target="_blank">www.fluxit.com.ar</a></span><span style="font-family:arial,sans-serif;font-size:medium;border-collapse:collapse"><div style="font-size:13px;margin-top:5px;margin-right:15px;margin-bottom:5px;margin-left:15px;padding-bottom:20px">

<div><br></div></div><div style="font-size:13px;margin-top:5px;margin-right:15px;margin-bottom:15px;margin-left:15px;clear:both"></div><div style="background-color:rgb(247,247,247);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;width:auto;background-repeat:initial initial">

</div><div style="font-size:13px;background-color:rgb(247,247,247);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;width:auto;background-repeat:initial initial">

</div></span><br>
</div></font></span></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>