-
1. Re: Multi-threaded process execution?
rebody Jul 2, 2010 12:29 AM (in response to cntoomey)1 of 1 people found this helpfulHi Chris,
If you want to each branches of forked executions could be invoked in a seperated thread. you could use continue="async". You could find more information in dev-guide: http://docs.jboss.com/jbpm/v4/devguide/html_single/#jobexecutor
-
2. Re: Multi-threaded process execution?
cntoomey Jul 2, 2010 6:46 PM (in response to rebody)Thanks HuiSheng, ya I'd seen that but it looked pretty complicated and heavyweight, particularly triggering DB write and transactions for each such asynch node. In the fully in-process web-request-processing application I'm looking at I want to avoid transactions altogether. Looks like either I couldcreate and use my own lighter-weight MessageService implementation instead, or else do it another way e.g. w/ custom Fork and Join node implementations.
Chris
-
3. Re: Multi-threaded process execution?
rebody Jul 2, 2010 7:41 PM (in response to cntoomey)1 of 1 people found this helpfulHi Chris,
Let jBPM 4 support real Multi-Thread will be a good research direction. But please notice some thing. That the IoC containter of jBPM 4 based on the TheadLocal, so if you create Multi-Thread in your custom activity, you maybe have to face some problems, e.g. you cannot get components directly from Environment any more. And the transaction interceptor should be rewrite for Multi-thread scenario, you have to find a way to notify the interceptor when all of executions have completed, and whether the current transation could commit or should rollback.
So the current implementation of jBPM 4 based on the single-thread scenario could simplify many problem and easy to achieve. if you really want to achieve a Multi-Thread solution, please consider about these.
Good Luck.
-
4. Re: Multi-threaded process execution?
cntoomey Jul 4, 2010 2:23 PM (in response to rebody)Ok, thanks for the heads-up about that. What's the IoC container?
Chris
-
5. Re: Multi-threaded process execution?
rebody Jul 5, 2010 5:39 AM (in response to cntoomey)Hi Chris,
jBPM 4.x provide a IoC container to maintain all of internal components. Each time we saw EnvironmentImpl.getFromCurrent(), it means that we get a component from IoC container.
The EnvironmentImpl use ThreadLocal to store the current context which stored component, so it maybe cannot be used in Multi-Thread scenario directly.