cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry - using a Rule to search all objects of multi-nested collections

former_member231132
Participant
0 Kudos

I'm trying to use a Rule to come up with the COUNT of all instances of an object that is stored in a nested collection three levels deep.  My data structure looks like:

MainObject

     StationsCollection

     Stations

          UnitsCollection

          Units

               TagTemplatesCollection

               TagTemplates

                    Order

I want to be able to count all instances of the TagTemplates object that have a zero stored in its Order Property.  My thought was that I would simply be able to use a Rule that would reference all instances of Stations object, Units object, and TagTemplates object (within their respective collections) and return the count of all TagTemplates that have an Order value of zero.  A rule something like:

COUNT

     StationsCollection Property 😆 All UnitsCollection Property 😆 All TagTemplatesCollection Property

     EQSTR

          Order Property

          0

However, when I go to the property browser to specify the collection to pass to the COUNT function, it only lets me go two levels deep.  As you can see below, when I select "All UnitsCollection", there is no way to expand to the next level down. 

Am I doing something wrong, or is there a better way to do this?

Thanks

Tim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think you are going to have to do nested for loops for each collection, and sum the count in a property on the Main object.

Are you familiar with how to loop over collections in agentry?

Michael

former_member231132
Participant
0 Kudos

Thanks for your reply.  Yes I'm familiar with looping over collections, which is the way I ended up doing it.   I just assumed that there would be a way to do this within a rule.  It would be nice if in a future release SAP would make this available.

Thanks

Answers (0)