0 Replies Latest reply on Oct 7, 2009 5:53 AM by Michael Wohlfart

    is async execution considered inactive?

    Michael Wohlfart Expert

      Hi guys,

      I have a (pretty hackish) process definition with custom task activities implemented as java classes, these activities basically just create a default task, the relevant part of the process definition looks like this:

      <custom class="net.package.CustomTaskActivity" name="custom01">
       <on continue="async" event="forward">
       <mail class="net.package.CustomMailProducer" >
       <field name="tmplName"><string value="templatename"/></field>
       </mail>
       </on>
      
       <transition name="forward" to="custom01"/>
       <transition name="toCreateBusinessKey" to="custom02"/>
      </custom>
      


      the forward transition is supposed to be a loop just creating the same task activity for a different user, this is handled in a custom task implementation.

      The Problem is when i take the "forward" transition I get an exception telling me the Execution is not active:
      org.jbpm.api.JbpmException: execution[ChangeRequest.15] is not active: async
       at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:999)
       at org.jbpm.pvm.internal.model.ExecutionImpl.take(ExecutionImpl.java:447)
       at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:140)


      I checked the code and according to my understanding it all boils down to the implementation of the ScopedInstanceImpl.isActive() method:

      public boolean isActive() {
       return Execution.STATE_ACTIVE_ROOT.equals(state)
       || Execution.STATE_ACTIVE_CONCURRENT.equals(state);
       }
      


      My question is: Why isn't there a check for Execution.STATE_ASYNC? Is an async continuation considered to be not active?