cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass each value in a record to looping process call in SAP cpi

mounikaravilla
Explorer
0 Kudos

Hi Team,

We have a requirement where values are taken in an array and pass each value to the looping process call at a time, so that looping process will be executed for one value at a time, how to achieve this

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

You could consider the following approach:-

- In a script loop through the values of the array adding a 'newline' character to each individual value. Set the body of the message to the output from this loop. Now your message body would look like the below:-

- array[1] + '\n'[newline char]

array[2] + '\n'

array[n]+ '\n'

- Pass this to an iterating splitter with the split expression type as 'Line Break'. This will send out each array element as a distinct message.

- Post the splitter step, the 'looping' process call can be called with the escape condition as ${header.CamelSplitComplete} = 'true'

mounikaravilla
Explorer
0 Kudos

Hi Anand,

Thanks for your reply
Is there any way to achieve this without using iterating splitter.
how can we do this using groovy script?

0 Kudos

Hi Mounika - Not sure if a groovy script can be used to replicate splitter-functionality.