<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Yes, Thank you. That helps quite a bit.</div><div><br><div><div>On Jan 13, 2011, at 11:45 PM, Wolfgang Laun wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">A (single or joined) cell below CONDITION must contain something that results in a valid pattern when<br><ol><li>a pair of parentheses is appended</li><li>the constraint(s) resulting from the cells below are inserted into these parentheses</li>
</ol>Looking at "person: Person, &nbsp;op: Person from otherPersonList<span style="white-space: pre-wrap;"></span>", you realize that "person: Person, op: Person" is not a valid CE, not even if you omit the comma&nbsp; Also, the cell cannot end with "from otherPersonList".<br>
<br>A constraint (2 rows down from CONDITION) is expanded with values from cells below it by appending "==" and the cell value.<br><br>Apart from the basic design flaw Greg has pointed out: you can add a from clause by using an additional column with "from otherPersonList<span style="white-space: pre-wrap;">" in the 3rd row after RuleTable and an 'x' in each of the value cells.<br>
<br>You will also have to change the constraint  "</span><span style="white-space: pre-wrap;">p</span>erson.getRelationShip(op)<span style="white-space: pre-wrap;"></span> == ..." into an eval since this isn't correct constraint syntax.<br>
<br>-------------------------------<br>&nbsp;&nbsp; CONDITION<br>&nbsp;&nbsp; person: Person() op: Person<br>&nbsp;&nbsp; activity<br>&nbsp;&nbsp; PLAYING&nbsp; <br>-----------------------------<br>&nbsp;&nbsp; CONDITION<br><br>&nbsp;&nbsp; from otherPersonList<br>&nbsp;&nbsp; x<br>------------------------------<br>
&nbsp;&nbsp; CONDITION<br><br>&nbsp;&nbsp; eval( "$param".equals( <span style="white-space: pre-wrap;">p</span>erson.getRelationShip(op)<span style="white-space: pre-wrap;"></span> ) )<br>&nbsp;&nbsp; FRIEND<br>-------------------------------<br>
<br><br>I suggest that you try and write your rules in DRL first before you start thinking about decision tables. As you can see, certain conditions and CE combinations cannot be expressed in tables. After all, a row of cells is linear, but the syntaxl of LHS expression includes non-linear (recursive) structures.<br>
<br>-W<br><br><br>&nbsp; <br><div class="gmail_quote">2011/1/13 Gregory Mace <span dir="ltr">&lt;<a href="mailto:gregorymace@earthlink.net">gregorymace@earthlink.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;">
<div style=""><div><div style="margin: 0px;">Here is a simple example where 'otherPersonList' is a global java.util.List:</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">RuleTable Are friends having fun</div>
<div style="margin: 0px;">CONDITION<span style="white-space: pre-wrap;">                                                </span>CONDITION<span style="white-space: pre-wrap;">                                        </span>ACTION</div><div style="margin: 0px;">


</div><div style="margin: 0px;">person: Person, &nbsp;op: Person from otherPersonList<span style="white-space: pre-wrap;">        </span></div><div style="margin: 0px;"><span style="white-space: pre-wrap;">p</span>erson.getRelationShip(op)<span style="white-space: pre-wrap;">                                </span>op.getActivity()<span style="white-space: pre-wrap;">                                </span>System.out.println("$param");</div>
<div style="margin: 0px;">FRIEND<span style="white-space: pre-wrap;">                                                        </span>PLAYING<span style="white-space: pre-wrap;">                                                </span>Your friend is having fun</div><div style="margin: 0px;">ENEMY<span style="white-space: pre-wrap;">                                                        </span>WORKING<span style="white-space: pre-wrap;">                                                </span>Not your friend and not having fun</div>
<div style="margin: 0px;"><br></div><div style="margin: 0px;">which produces the following drl output:</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">#From row number: 31</div><div style="margin: 0px;">
rule "Friends are having fun_31"</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; min-height: 15px; ">
<span style="white-space: pre-wrap;">        </span><br></div><div style="margin: 0px;"><span style="white-space: pre-wrap;">        </span>when</div><div style="margin: 0px;"><span style="white-space: pre-wrap;">                </span>person: Person, op : Person from otherPersonList(person.getRelationShip(op) == "FRIEND", op.getActivity() == "PLAYING")</div>
<div style="margin: 0px;"><span style="white-space: pre-wrap;">        </span>then</div><div style="margin: 0px;"><span style="white-space: pre-wrap;">                </span>System.out.println("Your friend is having fun ");</div><div style="margin: 0px;">
end</div><div style="margin: 0px; min-height: 15px;"><br></div><div style="margin: 0px;">#From row number: 32</div><div style="margin: 0px;">rule "Friends are having fun_32"</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; min-height: 15px; ">
<span style="white-space: pre-wrap;">        </span><br></div><div style="margin: 0px;"><span style="white-space: pre-wrap;">        </span>when</div><div style="margin: 0px;"><span style="white-space: pre-wrap;">                </span>person: Person, op : Person from otherPersonList(person.getRelationShip(op) == "ENEMY", op.getActivity() == "WORKING")</div>
<div style="margin: 0px;"><span style="white-space: pre-wrap;">        </span>then</div><div style="margin: 0px;"><span style="white-space: pre-wrap;">                </span>System.out.println("Not your friend and not having fun");</div>
<div style="margin: 0px;">end</div></div><div><br></div><div>shouldn't the 'from' be after the statement like this:?</div><div><span style="font-family: Monaco; font-size: 11px;"><br></span></div><div><span style="font-family: Monaco; font-size: 11px;">person: Person, op : Person(person.getRelationShip(op) == "ENEMY", op.getActivity() == "WORKING")&nbsp;</span><span style="font-family: Monaco; font-size: 11px;">from otherPersonList</span></div>
<div><font face="Monaco" size="3"><span style="font-size: 11px;"><br></span></font></div><div><span style="font-family: Monaco; font-size: 11px;">Thx</span></div><div><div></div><div class="h5"><div><br></div><div><div>On Jan 13, 2011, at 11:47 AM, Wolfgang Laun wrote:</div>
<br><blockquote type="cite">I think I understand your question, but I'm not sure how to answer it. ;-)<br><br>What, exactly, are you trying to do? "Pulling" from a list means what?<br><br>-W <br><br><br><div class="gmail_quote">
On 13 January 2011 20:34, Gregory Mace <span dir="ltr">&lt;<a href="mailto:gregorymace@earthlink.net" target="_blank">gregorymace@earthlink.net</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 believe I have the list set up correctly as a variable, but I am not sure how to set up a condition that pulls from a global list. &nbsp;Any examples?<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>
_______________________________________________<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></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>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote></div><br></div></div></body></html>