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.

The java representation of these Objects are as Follows

Class Message {
    private Attributes attributes;
}

Class Attributes {
    private ArrayList<AttributeParams> attributeParams;
}

Class AttributeParsms {
   private String name;
}


This is my drl file,
when
        m : Message( myAttributes : attributes)
then
        System.out.println(myAttributes);
        System.out.println(myAttributes.getAttributeParams());
        System.out.println( myMessage );

when I fire my rule, this is the output I am getting.

com.sample.Attributes@39c639c6
[com.sample.AttributeParams@39a639a6, com.sample.AttributeParams@39ac39ac]

From the result we can see that we have two Attribute objects in the ArrayList.
How can I iterate through the ArrayList to get a perticular AttributeParams object


--
Ashok Deivasigamani