Yikes!<br><br>This I had not even noticed.<br><br>Customer and ServiceContext should both be inserted as Facts.<br><br>Some rules might need to be re-written:-<br><br>rule &quot;Customer null check rule&quot;<br>
no-loop true<br>
salience 1000<br>
        when<br>
                not ( Customer() )<br>
        then<br>
                throw new MissingEntryFault(&quot;Customer is required&quot;);<br>
end<br><br><div class="gmail_quote">rule &quot;Service Context null check rule&quot;<br>

no-loop true<br>

salience 1000<br>

        when<br>

                not ( ServiceContext() )<br>

        then<br>

                throw new MissingEntryFault(&quot;ServiceContext is required&quot;);<br>

end<br><br>You must be inserting some (at least one) Customers in working memory otherwise rules like this won&#39;t match anything:-<br><br>rule &quot;PAN Device null or empty rule&quot;<br>
no-loop true<br>
salience 300<br>
        when<br>
                $customer : Customer()<br>
                $esi : ElectricServiceInterface() from $customer.getElectricServiceInterfaces()<br><div id=":10v">
                eval( $esi.getPANdevices() == null || $esi.getPANdevices().size()&lt;=0 )<br>
       then<br>
                throw new MissingEntryFault(&quot;PAN Device list cannot be null or empty&quot;);<br>
end</div><br>Which itself could be re-written removing the eval (I don&#39;t think you&#39;ll get an NPE in the last &quot;from&quot;):-<br><br>rule &quot;PAN Device null or empty rule&quot;<br>
no-loop true<br>
salience 300<br>
        when<br>
                $customer : Customer()<br>
                $esi : ElectricServiceInterface() from $customer.getElectricServiceInterfaces()<br><div id=":10v">
                not ( PANDevice() from $esi.getPANdevices() )<br>
       then<br>
                throw new MissingEntryFault(&quot;PAN Device list cannot be null or empty&quot;);<br>
end</div><br><br>On 15 December 2011 16:03, Venkat <span dir="ltr">&lt;<a href="mailto:ven12344@yahoo.com">ven12344@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Manstis, I see what you are saying, and yes I not doing any update in my<br>
facts. If you see the rule file, there is global variable which defines the<br>
Customer and ServiceContext and also I am declaring the Customer object<br>
again in each rule.<br>
<br>
This is because I could not get those global variables access in other<br>
rules, can you tell me how to get those variables in other rules also.<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">Venkat.<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Eval0Invoker-java-lang-NullPointerException-tp3586222p3589057.html" target="_blank">http://drools.46999.n3.nabble.com/Eval0Invoker-java-lang-NullPointerException-tp3586222p3589057.html</a><br>

</font></span><div class="HOEnZb"><div class="h5">Sent from the Drools: User forum 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>