cancel
Showing results for 
Search instead for 
Did you mean: 

FOREACH scenario : usage of Receiver or Interface variable

Former Member
0 Kudos

Hi fellow ccBPMers

I have scenario with flat files that must be read and split up into individual files.

First file is a Header Flat File containing 4 Header records

A xxxxxxxxxxxx 
B xxxxxxxxxxxx
C xxxxxxxxxxxx
D xxxxxxxxxxxx

Second file is a Detail Flat File containing the associate Detail records

A Line 1 
A Line 2 
B Line 1 
B Line 2 
B Line 3 
C Line 1
D Line 1
D Line 2
D Line 3
D Line 4

This must be merged and produce another 4 files (they will be IDOCS)

File1 :  A xxxxxxxxxxxx  with a Line 1 and 2

File2:   B xxxxxxxxxxxx  with Line 1 and 2

File3 :  C xxxxxxxxxxxx  with Line 1

File4 :  D xxxxxxxxxxxx  Line 1, 2, 3 and 4

I have considered the usage of a Block FOREACH to process a multiline container that I have set up that should contain a record for each grouping of lines.

Now for the FOREACH the multiline element lets me choose either a Receivers (from a ReceiverDetermination step)

OR seems that also choose an instance variable of my collected group of records.

Question then is : If I choose the instance variable, will the FOREACH simply loop through each collected group of records and send them one at a time (if so I would not need the determine receivers step - as suggested by saphelp doco).

I'd appreciate it if somebody could consider the scenario and provide an opinion. Points awarded of course !

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

Receiver determination step is not necessarily mandatory for block in foreach mode.

In case you don't determine the receiver in the bpm (or you don't define an specific send context) the receiver will be determined by default receiver determination during technical routing.

Regards,

Henrique.

Former Member
0 Kudos

Here is a description of my Integration Process.

It has a FORK with 2 steps. step1 to Receive a BODY and Collect into multiline HeaderContainer

and step 2 to Receive a HEADER and Collect into multiline BodyContainer

next has a TRANSFORMATION with source being the HeaderContainer and the BodyContainer and target CollectedHeaderandBody

next a FOREACH Block has multiline element of CollectedHeaderandBody and current line as a CollectedLine (of the CollectedHeaderandBody)

within the FOREACH block it will SEND the CollectedLine.

Does that seem correct ?

Edited by: Paulie Seikmayt on Apr 18, 2008 3:45 PM

Former Member
0 Kudos

Correlate on the key of the Header and Body files as you receive them too. The collectmulti line container can then like you say be processed and sent out.

Answers (1)

Answers (1)

VijayKonam
Active Contributor
0 Kudos

You are right. In the block step if you select foreach, it would iterate through the lines in the multiline container and send them (if you have a send step defined in this block).

VJ