Nested Loop Issue

Hi Friends,
I am just a starter and need basic but detailed solution. I have to implement nested loop in the following situation:

– I have bizdocs as pipeline input where I can have multiple bizdoc instances like :
BizDocs
– BizDocs[0]
– BizDocs[1]
.
.
– BizDocs[M]

– Within a bizdoc[M], I have contentParts as an attribute which also can have multiple instances like :

- BizDocs  
  -- BizDocs[0] 
    --ContentParts[0] 
    --ContentParts[1] 
    --ContentParts[N] 
 -- BizDocs[M] 
   -- ContentParts[0] 
   -- ContentParts[N] 

I hope you understand the input structure. Within ContentParts, I have attribute called length. I need to traverse each and every contentParts and execute a branch on the basis of length. But each and every step, I need to process corresponding contentParts portion.

I have seen many options like append to Doc List or converting into XMLValues etc. I do not want such solutions but simple one which I can use in webMethods Developer’s flow service.
I have so far implemented written following flow service:

loop (over ‘/BizDocs’)
loop (over ‘/BizDocs/contentParts’)
– Execute my service.
I am not defining any output array since I do not know how to handle them. I request someone to prepare such a working flow service in developer and send a screenshot to me along with step by step instruction. I am hopeful that starter like me will benefit from this group.

Hello,

Yemi Bedu

Thanx for your advise. Infact, my main problem is not to get length of contentParts (I know it). My issue deals with writing loop part. I have tried it and even pasted the code written by me in my message. I am really confused about providing subscript operator part.
bizdocs[0]/contentParts[0]/length works fine but the problem is that it works only for first contentPart for first Bizdoc. I want to include iterations for each and every contentPart. I hope you understand my difficulty. Any way thanx for your swift and honest reply.

Naveen,

loop (over ‘/BizDocs’)
loop (over ‘/BizDocs/contentParts’)
–Branch(set evaluate labels to true)
----Execute my service1(set the label to %bizdoc/Contents/length%=for whatever length you want to execute this service).
----Execute my service2(set the label to %bizdoc/Contents/length%=for whatever length you want to execute this service).

HTH
ramesh.

Hi Ramesh,
I am thankful to you for providing a clear and up to the point explanation. I guess you mean :

loop (over ‘/BizDocs’)
loop (over ‘/BizDocs/contentParts’)
–Branch(set evaluate labels to true)
----Execute my service1(set the label to %bizdoc/ContentParts/length%=for whatever length you want to execute this service).
----Execute my service2(set the label to %bizdoc/ContentParts/length%=for whatever length you want to execute this service).

I will try it tomorrow in office and update you about the results. Do I need to invoke MAP after every loop construct?
Good day

Naveen,

No need to invoke map step.

ramesh.