cancel
Showing results for 
Search instead for 
Did you mean: 

Is fork (being referred for paraller processing) really uses Multi-threading?

Syed1234
Explorer
0 Kudos

Hi All,

I have a queston that I was following Henrique Pinto technique  @ http://scn.sap.com/message/3369524#3369524

I got an observation that when I created two branches and in one branch i just used a dumb transforamtion step to deliberately make that branch to wait  for some required time, the steps of both branch is executing sequentially, meaning that when 1 step completes of either branch then the next step is executed, rather than executing steps of each branch in seperate thread (or process).

This is failing the technique to make wait 1 branch and to execute other branch. As holding 1 branch through Thread.sleep is causing whole process to wait.

Could anybody explain this thing clearly?

Accepted Solutions (1)

Accepted Solutions (1)

tobias_breyer
Contributor
0 Kudos

Hi,

linking to Henrique's comment suggests that you speak of ccBPM.

What is documented for ParForEach at http://help.sap.com/saphelp_nw73ehp1/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/frameset.htm is valid for the fork step as well. It will not execute in parallel threads, just logically have separate control flows which are joined together later again.

Henrique's solution might have worked 6 years ago, but this has been by chance, exploiting "buggy" behavior that has been fixed since.

A design principle of Business Workflow (and therefore ccBPM) is that there is no multi-threaded, concurrent processing inside a single process instance. So never try to trick the engine into running several threads inside a single process instance. That will never be reliable, even if it seems so in special circumstances.

Tobias

Syed1234
Explorer
0 Kudos

Hi Tobias,

Thanks for your reply. I got your point and fork concept in PI. Sorry for my earlier post as it was posted before your reply came, but it was stuck in moderation time .

So this technique won't work now. Could you please explain why we have at least unit time in ccBPM (like deadline branch) minutes rather than seconds? As in synchronous cases, the process leads to delay the response to the ERP end user who initiated the request.

Thanks.

tobias_breyer
Contributor
0 Kudos

Deadline handling of ccBPM is based on the ABAP Batch Processing framework, whose granularity is basically only minutes, so ccBPM cannot go beyond that. You can just optimize a little in that respect, e. g. reduce additional technical delays by decreasing the scheduling period of SWWDHEX job from 3 to 1 minute. Those 3 minutes are the default scheduling period, which is a trade-off between server load and timeliness of the deadlines.

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Syed,

Fork branches are independt to each other and exeucutes in parrlel way thats why you are BPM behvaing that way.

Try using swtich step.

Syed1234
Explorer
0 Kudos

Hi Raja,

My requirement is to execute both fork branches independently, but it is not happening like this (maybe due to transport acknowledgement Send step, just a guess).

I have two branches in fork,

1. 1 branch with transformation step to make it wait for some seconds (thread.sleep). then control step to throw exception.

2. all the steps defined in 2nd branch to execute my requirement. here first is send step with transport acknowledgement.

When i execute this Integration Process, and it reaches to fork step, the transformation step in first branch make hold the whole process to wait for the thread.sleep time period, meaning the steps in 2nd branch is NOT executing simultaneously. It just stuck at its first step until and unless the transformation step does not complete, 2nd branch is not executing further.

Why it is happening such a way when it has to execute independently?

tobias_breyer
Contributor
0 Kudos

Hi Syed,

please read my comment below. Forks just mean logically parallel control flows, no multi-threading that you want to have here. Even if you achieve the behavior that you look for, it will just be by chance and the desired behavior might be gone after even subtle changes to your process definition or changes in execution timings.

Tobias