Skip to Content
author's profile photo Former Member
Former Member

Diff between ForEach & ParForEach blocks in BPM

Hi,

Can anyone let me know the difference between ForEach & ParForEach blocks? I am aware of the fact that ForEach gets executed sequentially and ParForEach gets executed parallelly from SAP help. But what I require is "Does usage of ParForEach improve the performance, since it executes parallelly, when compared with ForEach which executes sequentially. If not, how does ForEach behave compared with ParForEach?

Thanks

Sreeks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 08:16 PM

    Hi,

    The main difference between the two is the scenarios where they are used,

    parforeach : is mainly used in places where you have to fork for seperate requests, and have to collect individual responses into a single message.

    foreach : is maily used in places where sequencial processing is important or the order of the message has to be preserved by executing.

    As for which is better you could probably judge interms of cost(memory) vs performance. Parforeach forks a seperate flow for each path(thread on java stack + work flow on abap stack), and if your message is huge, you will be having n*message+BPM initialization cost, where n is the number of paths.

    the very nature of Foreach enables recycling of memory and there by for each execution it uses only message+BPM initialization cost.

    Bottom line, use parforeach where you need to use fork-collect pattern.

    Naveen

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.