Yes, much the same as you would with a RDBMS.<br><br>You'll have to insert the individual Lists (either by inserting their members, or by using "from").<br><br>Outer product:-<br><br>when<br> FactA( )<br> FactB( )<br>
then<br><br>Inner join:-<br><br>when<br>
FactA( $pk : pk)<br>
FactB( fk == $pk )<br>
then<br>
<br>left and right joins follow similarly (you'd have to check if the outer key equals or is null).<br><br><br><div class="gmail_quote">On 13 June 2012 13:04, soumya_sd <span dir="ltr"><<a href="mailto:soumya_sd@yahoo.com" target="_blank">soumya_sd@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it possible to have a rule that creates something similar to a SQL join.<br>
<br>
For example, the working memory has the following:<br>
<br>
List<Fact_A> and List<Fact_B>.<br>
<br>
In the "if" of the drl rule we want to check<br>
<br>
if Fact_A.someAttribute (some_condition) Fact_B.someOtherAttribute<br>
//some_condition could be .equals(), .startsWith(), notEquals() ...<br>
<br>
then<br>
//somehow Fact_A and Fact_B<br>
<br>
Any examples or pointers would be greatly appreciated.<br>
<br>
Thanks.<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Is-it-possible-to-implement-something-similar-to-a-SQL-join-in-Drools-tp4017908.html" target="_blank">http://drools.46999.n3.nabble.com/Is-it-possible-to-implement-something-similar-to-a-SQL-join-in-Drools-tp4017908.html</a><br>
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>
</blockquote></div><br>