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 "Customer null check rule"<br>
no-loop true<br>
salience 1000<br>
when<br>
not ( Customer() )<br>
then<br>
throw new MissingEntryFault("Customer is required");<br>
end<br><br><div class="gmail_quote">rule "Service Context null check rule"<br>
no-loop true<br>
salience 1000<br>
when<br>
not ( ServiceContext() )<br>
then<br>
throw new MissingEntryFault("ServiceContext is required");<br>
end<br><br>You must be inserting some (at least one) Customers in working memory otherwise rules like this won't match anything:-<br><br>rule "PAN Device null or empty rule"<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()<=0 )<br>
then<br>
throw new MissingEntryFault("PAN Device list cannot be null or empty");<br>
end</div><br>Which itself could be re-written removing the eval (I don't think you'll get an NPE in the last "from"):-<br><br>rule "PAN Device null or empty rule"<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("PAN Device list cannot be null or empty");<br>
end</div><br><br>On 15 December 2011 16:03, Venkat <span dir="ltr"><<a href="mailto:ven12344@yahoo.com">ven12344@yahoo.com</a>></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>