<div><br></div>   Syntactically speaking, I don&#39;t think the eval is necessary:<div><br></div><div>  $response : Response( $question : question, question.ID == &quot;XYZ&quot; ) <br><br></div><div>   Behind the scenes Drools will still generate an eval to resolve the nested property constraint, but the rule stays simple to read and maintain.</div>
<div><br></div><div>   Edson</div><div><br><div class="gmail_quote">2010/6/2 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The &quot;inline eval&quot; constraint is what you want: a boolean expression,<br>within parentheses.<br><br>  $response : Response( $question : question, eval(question.getID().equals( &quot;XYZ&quot; ) ) ) <br><br>See the Drools Expert manual, section on &quot;Left Hand Side...&quot;<br>
<font color="#888888">
<br>-W</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On 1 June 2010 23:54, Laird Nelson <span dir="ltr">&lt;<a href="mailto:ljnelson@gmail.com" target="_blank">ljnelson@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
I have a fact that is inserted into my rule base.  It is a Response.<br>
<br>
A Response has a Question that it is a response to.  At the moment,<br>
the Question itself is not separately inserted into the knowledge<br>
base.  I would ideally like to keep it this way.<br>
<br>
What&#39;s the best approach for binding variables to both the Response<br>
and its associated Question?<br>
<br>
That is, if the Question were inserted, it would be relatively easy:<br>
<br>
when<br>
  $question : Question( )<br>
  $response : Response( question == $question )<br>
<br>
...but I&#39;m finding myself somewhat confused how to &quot;extract&quot; a<br>
Question out of a Response, particularly when, say, I want to &quot;select&quot;<br>
only Responses whose associated Question IDs are &quot;XYZ&quot;:<br>
<br>
when<br>
  $response : Response( $question : question.ID == &quot;XYZ&quot; ) // boy<br>
howdy does this seem wrong<br>
<br>
Is the easiest thing to do here to add a second rule that just inserts<br>
the questions:<br>
<br>
when<br>
  $response : Response<br>
then<br>
  insert($response.getQuestion())<br>
end<br>
<br>
...?  I would love to stay away from this if I could.<br>
<br>
Thanks,<br>
Laird<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</blockquote></div><br>
</div></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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>