-
1. Re: jBPM DispatcherThread : J2SE and JEE behavior
sebastian.s Apr 29, 2010 2:06 PM (in response to zecas)Hello zecas,
if I understand your post correctly it seems to me that you have misunderstood the way jBPM works. Please read the section about asynchronous continuations in the jBPM documentation. The section explains jBPM's behaviour quite well.
If you invoke a jBPM operation - as starting a process for example - the process is executed in the same java thread as the invocation originates from. The process is then executed till it reaches a state where no further activities can be executed. This is the case if the process arrives in a waiting state or in a user task for example. If you don't want this behaviour you can use the async-setting on nodes. This tells jBPM to execute the node via the JobExecutor. The JobExecutor is reponsible for continuing the execution as well as for the execution of timers.
The JobExecutor itself is a thread which need to be started on jBPM initialization. Speaking of jBPM 3.2 this can be achieved via the JobExecutor servlet for example. For the actual execution of activities the JobExecutor maintains a pool of threads to perform the work. You can configure how many threads should be created.
P.S.: You did not mention which version of jBPM you are using but the overall behaviour should be the same for both jBPM 3.2 and 4.x.
HTH
Sebastian
-
2. Re: jBPM DispatcherThread : J2SE and JEE behavior
rebody Apr 29, 2010 11:38 PM (in response to zecas)Hi Zecas,
As Sebastian said, the DispatcherThread is just used to find and execute Async Job and Timer. It won't affect process engine.
The process engine is very simple. When you called service method, like executionService.startProcessInstanceById(), process engine will invoke related Command to execute process, the process will run through process definition until it arrival a wating Activity(StateActivity or TaskActivity) or arrival EndActivity. Whatever it turn to wait or end state, ther service will return and we could get the process instance. One request, One response.
-
3. Re: jBPM DispatcherThread : J2SE and JEE behavior
zecas May 4, 2010 4:34 AM (in response to rebody)Thanks for the answers, they helped me understanding why the thread launches.
I'm using version 4.3
My thoughts were that I call a jbpm api method, and it keeps running on the same thread until it needs further input, or the process ends, but the thread was just confusing me.
I'll take a better look into jobs in the near future, as I'm learning as much as I can about jbpm.
Thanks.