Merge the result of 2 (or more) flows

18 Dec '13, 11:46 AM
Forum Forum Starter - Level 2

Hello there.
I need to merge the result of 2 different units. Those results are lists.
Adding the 2nd entire list at the end of first list would work for me.
Is there anyway to do that?

x 2
Answer Answer at this question and get points!
Forum Starter - Level 2

Hi Manuel,

one way to do it is using a script unit accepting the two arrays.

The code of the script should be something like this:

#input´╗┐ String[] arrayOne, String[] arrayTwo #output String[] mergedArray def listOne = arrayOne as List def listTwo = arrayTwo as List def mergedList = (listOne << listTwo).flatten() return ["mergedArray": mergedList.toArray()]

Let me know if you have any issue with this solution.


x 1
Forum Starter - Level 2

Hello Roberto,
First of all I would like to thank you for your fast answer.
I'm doing it with a solution pretty like your. It works. In addition, I have to do a few things more in the script. But in my opinion it is not nearly as reliable and maintainable as WR's units are. More over it is hard to debug.
BTW I must say you that it is a fair solution.
Thanks again!

x 0
Answer at this question and get points!