<div dir="ltr"><br>&nbsp;&nbsp; This is a surprise for me, because you should get a compilation error for that. What version of Drools are you using?<br><br>&nbsp;&nbsp; Anyway, you can&#39;t do that. When you use &quot;or&quot;, Drools will internally create one subrule for each logical branch in your LHS. So, any variable you use in the RHS must be bound in all possible logical branches.<br>
<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/8/19 hatzlj <span dir="ltr">&lt;<a href="mailto:hatzl.j@a1.net">hatzl.j@a1.net</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hello everybody,<br>
<br>
on the LHS of my rule i connect several Conditions with OR and have<br>
different variable bindings for this Condition. Now - if any of this<br>
conditions does not fire, i assume that the binding variable is not created,<br>
so I can&#39;t access it in the RHS. This results in an null pointer exception<br>
when I call the fireAllRules-Command in my Java Application.<br>
<br>
A simple rule example:<br>
rule &quot;Rule 1&quot;<br>
 &nbsp; when<br>
 &nbsp; &nbsp; &nbsp;HKT: Parameter(parameterCode = &quot;HKT&quot;, value &lt; normalFloor) or<br>
 &nbsp; &nbsp; &nbsp;GGT: Parameter(parameterCode = &quot;GGT&quot;, value &lt; normalFloor) or<br>
 &nbsp; &nbsp; &nbsp;HSR: Parameter(parameterCode = &quot;HSR&quot;, value &lt; normalFloor) and<br>
 &nbsp; &nbsp; &nbsp;GOT: Parameter(parameterCode = &quot;GOT&quot;, value &gt; normalFloor)<br>
<br>
 &nbsp; then<br>
 &nbsp; &nbsp; &nbsp;System.out.println(HKT.toString();<br>
<br>
end<br>
<br>
So my Question is: Is there any way to check in the RHS wheter the pattern<br>
binding has been created or not or do i have to change the way of writing my<br>
rules (which i do not want to)?<br>
<br>
thanks,<br>
hatzlj<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Check-if-a-pattern-binding-exists-in-the-RHS-tp19032260p19032260.html" target="_blank">http://www.nabble.com/Check-if-a-pattern-binding-exists-in-the-RHS-tp19032260p19032260.html</a><br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<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>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>