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>
<br>-W<br><br><div class="gmail_quote">On 1 June 2010 23:54, Laird Nelson <span dir="ltr">&lt;<a href="mailto:ljnelson@gmail.com">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">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>