[jboss-user] [jBPM] - [jBPM4.4] process instance is in STATE_ASYNC

Jee Yi do-not-reply at jboss.com
Fri Dec 9 01:34:03 EST 2011

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


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


  public void signal(ActivityExecution execution, 
                     String signalName, 
                     Map<String, Object> parameters) {


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111209/93c045e7/attachment.html 

More information about the jboss-user mailing list