cancel
Showing results for 
Search instead for 
Did you mean: 

fork and parforeach

Former Member
0 Kudos

hi all,

diff between fork and parforeach

regards,

krish

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Krishna,

The exact difference is static and dynamic. I mean when you know the exact number of incoming messages where by you want do some process on each message then you can use Fork else you can use Block with mode ParForEach

ParForEach :

parforEach is used for Mode property with Block step in Integration process.

Block is used for to combine steps that you want to execute one after the other and which are to access the same local data .You can also use a block to combine steps that you want to have the same deadline or exception handler, or to define a local correlation.

In a dynamic mode, the block is executed for each line of a multiline container element. In ParForEach mode, an instance of the block is generated for each line of the multiline container element. All instances are processed simultaneously. In ForEach mode, the block first runs through for the first line of the multiline container element, then for the second, and so on.

You can use the ParForEach mode when you want to send a message to multiple receivers simultaneously, for example. To do so, you use a receiver determination step to determine a multiline container element with the list of receivers. You then define that the message is sent to these receivers in a block with the ParForEach mode. You can use the ForEach mode when you want to send a message to multiple receivers one after the other, for example.

You specify the multiline container element in the Multiline Element attribute. In the Current Line field specify a container element that takes the value of the multi-line container element for which the block will run.

You can define an end condition for the dynamic mode (see also: Condition Editor). This is checked as soon as the block has run through for one line of the multiline container element. The block is complete as soon as one of the lines of the multiline container element returns true for the end condition, or all lines of the multiline container element have been processed.

For more details see the link

http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/frameset.htm

Fork

You use a fork when you want to continue a process in branches that are independent of each other.

Please see the following link.

http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/frameset.htm

Regards

Chilla..

STALANKI
Active Contributor
0 Kudos

Krishna ,

Start reading the series https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5378. [original link is broken] [original link is broken] [original link is broken] [original link is broken]

It can be useful.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

You use FORK when you need to do parallel processing in independent branches. Each branch can have any step type and functionality.

Par For each is used with a Block when you need to repeat a sequence of steps for a given set of values! This is like the For Loop in any programming language.

More,

http://help.sap.com/saphelp_nw04/helpdata/en/24/e2283f2bbad036e10000000a114084/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/f6/e1283f2bbad036e10000000a114084/content.htm

Regards

Bhavesh

prabhu_s2
Active Contributor
0 Kudos

You can use the <b>ParForEach</b> mode when you want to send a message to multiple receivers simultaneously, for example. To do so, you use a receiver determination step to determine a multiline container element with the list of receivers. You then define that the message is sent to these receivers in a block with the ParForEach mode. You specify the multiline container element in the Multiline Element attribute. In the Current Line field specify a container element that takes the value of the multi-line container element for which the block will run.

prabhu_s2
Active Contributor
0 Kudos

Fork: Forking the process

say you have 3 transformations to be done (having 3 different mapping) from the input file(reciever). In this case you need to create a 3 branches where the recevier data is rotued to all the branches irrespective of any condition. In this case you go for a FORK.

ParforEach:

Used for parrallel processing of the message. It can be used where messages needs to be forked for seperate requests and individual responses are collected into a single message. I havent worked much on parforeach but good blogs are avaiable in the sdn. pls check out.

thkx

Prabhu

Former Member
0 Kudos

Hi Krishna,

In case of parforeeach, input messages ( of one message type) are processed simultaneously. Block is complete when end condition is satisfied.

e.g. If messages ( of single structure) to be sent to diffrerent receivers and get response.

Whereas in case of fork, each branch is processed simultaneously and here different interfaces with different message types can be configured.

e.g Messages (of different structures) to be received. If 3 message types then 3 branches to be configured.