<br>   The rule looks fine, so the problem is somewhere else: <br><br>* Are you properly implementing the equals()/hashcode() methods in the StatusProperty class? or are you checking for the exact same instance (in which case the defaul equals()/hashcode() would work)<br>
<br>* are you adding the properties to the TrainingStatus.properties collection before inserting TrainingStatus into the session? or are you calling update/modify after inserting it?<br><br>    Also, not related to the problem at all, but we recommend you to use modify() instead of update() in your rules consequence:<br>
<br>modify( t ) {<br>    setNextSection( &quot;section_b&quot; ),<br>    setPreviousSection( &quot;section_overview&quot; )<br>}<br> 
 <br>   []s<br>   Edson<br>
<br><br><div class="gmail_quote">2010/1/24 Mike Dougherty <span dir="ltr">&lt;<a href="mailto:mjdougherty@gmail.com">mjdougherty@gmail.com</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;">
Hello all,<br>
<br>
I&#39;ve been getting more and more into using Drools Expert, but I certainly still have a lot to learn. I have almost a complete rules file ready to go. But I am having an issue with the LHS checking that a collection contains a certain object value. The rule currently looks like this:<br>

<br>
rule &quot;Rule Name&quot;<br>
no-loop true<br>
        when<br>
            property : StatusProperty( name == &quot;propertyName&quot;, value == &quot;valueA&quot; )<br>
            t : TrainingStatus( currentSection == &quot;section_a&quot;, properties contains property )<br>
        then<br>
            t.setNextSection( &quot;section_b&quot; );<br>
            t.setPreviousSection( &quot;section_overview&quot; );<br>
            update( t );<br>
end<br>
<br>
<br>
The TrainingStatus object has the following fields:<br>
<br>
public class TrainingStatus implements Serializable {<br>
        private String currentSection;<br>
        private String nextSection;<br>
        private String previousSection;<br>
        private Set&lt;StatusProperty&gt; properties = new TreeSet&lt;StatusProperty&gt;();<br>
}<br>
<br>
And the StatusProperty object has the following:<br>
<br>
public class StatusProperty implements Serializable {<br>
        private String name;<br>
        private String value;<br>
}<br>
<br>
<br>
I&#39;m inserting a TrainingStatus object that should match this rule. But the resulting object does not have the nextSection and previousSection fields set to the values they should.<br>
<br>
Can anyone advise on how to get this rule working as expected?<br>
<br>
Thanks for your help!<br>
<br>
Mike<br>
<br>
<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><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>