webmethodswm-flow

webMethods loop over Document list


I am creating a flow service, and inside it, I inserted another flow, which has document list as output and contains 5 string fields. Problem is that I can't loop over that document list, whatever I put in Input array (getPropertyOutput, getPropertyOutput[0]) is ignored (in debug mode, it just skips the loop step). Same happening with the sequence step...

Any help would be appreciated


Solution

  • Let say I want to loop over list of Strings I have simple flow service:

    Loop example flow service

    In first step (MAP) I created the list...

    As second step, there are properties for LOOP important:

    Input array: /list
    

    But here is the trick, notice the icon in MAP step - there is String list, but in pipeline for debugLog step, there is list variable as String - it is the current String variable from list (I agree, very bad practice of SAG).

    enter image description here

    With Document list it will be very the same...

    I'd recommend to the the remap as first step in loop, for example:

    enter image description here

    Warning:

    LOOP is a very very slow construct in flow, so one shouldn't be using this at all. Alternative is to use Java for looping (yes, ugly again, but LOOP performance will kick you to a butt, sooner or later).