3

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

Betlista
  • 10,327
  • 13
  • 69
  • 110
Urosh
  • 95
  • 1
  • 2
  • 10

1 Answers1

3

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).

Betlista
  • 10,327
  • 13
  • 69
  • 110
  • Thanks, very helpful example! – Urosh Dec 15 '15 at 08:10
  • 1
    It is true that Flow LOOP performance is not good, BUT it is very much sufficient in 99.9% of all use cases. Do not use Java code instead of Flow code, this is not a best practice. Stick with Flow code, it is better readable, and maintainable, Java services in IntegrationServer aren't a real beauty. Only if you have real performance issues, use Java services. Or consider using the new application server capabilities of SAG, where you can program (complex) business in Java without all the IS Java-Service constraints, but being able to call Flow services via annotations (and vice versa). – Henning Waack Dec 21 '15 at 09:21
  • I strongly disagree, flow is not readable and difficult to maintain. Can you share something about this new AS? You meant version 9.9 or something else? – Betlista Dec 21 '15 at 10:00