Not as clear as I'd hoped; can you provide an actual rule DRL?<br><br><div class="gmail_quote">2010/10/13 Kumar Pandey <span dir="ltr"><<a href="mailto:kumar.pandey@gmail.com">kumar.pandey@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Michael<div> Here are some examples</div><div> </div><div>Rule1 has "str1", "Str2", "Str3"</div>
<div><br></div><div>Rule2 has "str2", "Str3", "Str5", "Str6", "Str7"</div>
<div> </div><div>Rule3 has "str1", "Str3", "Str6"</div><div><br></div><div>etc.</div><div><br></div><div>With fact1 that has "str1", "Str3" , since this is subset of values in Rule1 and Rule3, they should not fire but Rule2 should fire</div>
<div><br></div><div>With fact2 that has "str2", "Str6", "Str7", Rule 2 should not fire and Rule1 and Rule3 should fire. </div><div><br></div><div>Hope this is clear.</div><div><br></div><div>
Thanks</div><div>Kumar<br><br><div class="gmail_quote">2010/10/13 Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div class="h5">
Thanks, please provide a specific example rule too.<div><br></div><div>Don't forget to keep your posts to the mailing list for the good of the community.<div><div></div><div><br><br><div class="gmail_quote">
On 12 October 2010 22:18, Kumar Pandey <span dir="ltr"><<a href="mailto:kumar.pandey@gmail.com" target="_blank">kumar.pandey@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Michale<div> Thanks for the response.</div><div>Here's the link for the thread .</div><div><br></div><div><a href="http://drools-java-rules-engine.46999.n3.nabble.com/Check-if-fact-is-subset-of-items-in-the-rule-td1680013.html#a1680013" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Check-if-fact-is-subset-of-items-in-the-rule-td1680013.html#a1680013</a></div>
<div><br></div><div>and the original about matching strings in two arrays.</div><div><a href="http://drools-java-rules-engine.46999.n3.nabble.com/Matching-strings-in-two-arrays-td1602511.html#a1602511" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Matching-strings-in-two-arrays-td1602511.html#a1602511</a></div>
<div><br></div><div><br></div><div>My use case is that I could have hundreds of rule and each rule could have its own set of strings.</div><div>A fact object is run through these rules to see which ones are fired.</div><div>
One of the condition to check is that the a list in the fact is not a subset of list in the rule. </div><div>That is fire the rule only if list in fact is not a subset of list in rule.</div><div> </div><div>Thanks</div><div>
Kumar</div><div><br><br><div class="gmail_quote">On Tue, Oct 12, 2010 at 12:38 PM, Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
OK, I admit I don't have the original thread anymore.<br><br>If I am not wrong (which is always a possibility) for Wolfgang's operator to work you'd need to externalise the superset from the rule into WorkingMemory. You could have a rule with higher salience construct the superset WM fact.<br>
<br>If you don't mind re-posting or providing a link to the complete thread (on Nabble or somewhere) I'll happily try to help further.<br><br><div class="gmail_quote">On 12 October 2010 17:23, <span dir="ltr"><<a href="mailto:kumar.pandey@gmail.com" target="_blank">kumar.pandey@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><quote author='Michael Anstis-2'><div><br>
Wolfgang gave a great solution.<br></div>
</quote><br>
Don't know if I'm missing something obvious here. I have a superset in the rule itself. Each rule has a superset list. In this case how would I use Wolfgang's solution. Its comparing through two arrays in runtime. I have not been able to construct an array construct with specific values in the rule itself.<br>
</blockquote></div><br>
</blockquote></div><br><br>
</div>
</blockquote></div><br></div></div></div>
<br></div></div>_______________________________________________<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>
<br></blockquote></div><br><br clear="all"><br>
</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>