Jee Yi [
http://community.jboss.org/people/jeeyi] created the discussion
"[jBPM4.4] process instance is in STATE_ASYNC"
To view the discussion, visit:
http://community.jboss.org/message/640693#640693
--------------------------------------------------------------
Hi,
I have defined a workflow so that it starts asynchronously. And there is a custom
activity that implements ExternalActivity. In the execute method, I create Runnable
object and submit to a custom thread pool, and then call execution.waitForSignal(). The
new thread runs its own tasks and signals the execution in "work".
In the new thread, where it looks for the active execution in "work" sometimes
throws an exception:
Execution execution = processInstance.findActiveExecutionIn("work");
The reason is because the state of the process instance is STATE_ASYNC and not
STATE_ACTIVE_ROOT. Does anyone know why?
This is web application and we start multiple process instances concurrently. We are
using jBPM JobExecutor with default configuration. When I start about 10 process
instances, I see one or two process instances failed to move on to the next activity
because we were not able to signal the execution.
1) Does anyone know what's going wrong here?
2) Any suggestion how to make process instance move from STATE_ASYNC to
STATE_ACTIVE_ROOT?
3) Or is there a way to signal process instance in STATE_ASYNC?
| 5 | <start name="async-start" continue="async" > |
| 6 | <transition to="work"/> |
| 7 | </start> |
| 8 | |
| 9 | <custom name="work" expr="#{startWorkAndWait}"
> |
| 10 | <transition name="ok" to="send mail" /> |
| 11 | <transition name="error" to="send error mail" />
|
| 12 | </custom>
|
| 1 |
|
public *class StartWorkAndWait* implements *ExternalActivity* {
public void execute(ActivityExecution execution) {
// created Runnable and submitted to a custom ThreadPool
*execution.waitForSignal();*
}
public void signal(ActivityExecution execution,
String signalName,
Map<String, Object> parameters) {
*execution.take(signalName);*
}
}
Thanks,
Jee
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/640693#640693]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]