<div class="message-text" id="nabble.msgtxt24412171">I have a Message Object which has a Attribute Object which has a ArrayList of AttributeParams Objects. How can I iterate through the ArrayList to get to a perticular AttributeParans Object in the drl file. <br>
<br>The java representation of these Objects are as Follows <br><br>Class Message { <br>    private Attributes attributes; <br>} <br><br>Class Attributes { <br>    private ArrayList&lt;AttributeParams&gt; attributeParams; <br>
} <br><br>Class AttributeParsms { <br>   private String name; <br>} <br></div>


<div> </div>
<div>This is my drl file, <br>when <br>        m : Message( myAttributes : attributes) <br>then <br>        System.out.println(myAttributes); <br>        System.out.println(myAttributes.getAttributeParams()); <br>        System.out.println( myMessage ); <br>
<br>when I fire my rule, this is the output I am getting. <br><br>com.sample.Attributes@39c639c6 <br>[com.sample.AttributeParams@39a639a6, com.sample.AttributeParams@39ac39ac] <br><br>From the result we can see that we have two Attribute objects in the ArrayList. <br>
How can I iterate through the ArrayList to get a perticular AttributeParams object <br>This is my drl file, <br>when <br>        m : Message( myAttributes : attributes) <br>then <br>        System.out.println(myAttributes); <br>
        System.out.println(myAttributes.getAttributeParams()); <br>        System.out.println( myMessage ); <br><br>when I fire my rule, this is the output I am getting. <br><br>com.sample.Attributes@39c639c6 <br>[com.sample.AttributeParams@39a639a6, com.sample.AttributeParams@39ac39ac] <br>
<br>From the result we can see that we have two Attribute objects in the ArrayList. <br>How can I iterate through the ArrayList to get a perticular AttributeParams object <br><br clear="all"></div>
<div></div><br>-- <br>Ashok Deivasigamani<br>