1 Reply Latest reply on Jun 10, 2011 10:32 AM by saig0

    jBPM 4.4 end Process Instance

    pushpak1981

      I am trying to end a Process Instance from Decision Handler using executionService.endProcessInstance. But i get the following Error. The same code works if i try to end the Process instance from Java Activity.

       

      Is there anything i need to take care in case of decision handler ?

       

      20:34:29,489 ERROR [ExecuteJobCmd] exception while executing 'ExecuteActivityMessage[50052]'
      org.jbpm.api.JbpmException: execution[TEST.2646] is not active: ended
              at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:1084)
              at org.jbpm.pvm.internal.model.ExecutionImpl.take(ExecutionImpl.java:481)
              at org.jbpm.jpdl.internal.activity.DecisionHandlerActivity.execute(DecisionHandlerActivity.java:69)
              at org.jbpm.jpdl.internal.activity.DecisionHandlerActivity.execute(DecisionHandlerActivity.java:42)
              at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
              at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
              at org.jbpm.pvm.internal.model.op.ExecuteActivityMessage.executeVoid(ExecuteActivityMessage.java:45)
              at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:46)
              at org.jbpm.pvm.internal.job.MessageImpl.execute(MessageImpl.java:32)
              at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:79)
              at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
              at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
              at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:83)
              at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:62)
              at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
              at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
              at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
              at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
              at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
              at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
              at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
              at java.util.concurrent.FutureTask.run(FutureTask.java:138)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)
      
        • 1. Re: jBPM 4.4 end Process Instance
          saig0

          I think it is not possible to end the process in a decision handler, cause a decision is not a stable state in process. So after the process execute the code in decision, the process try to take a transition and throw the exception while check if the process is still active.

           

          Please note that a process should always end in an end activity.

          Maybe you can show your process. I created processes with similar behavior too. In my case I ended concurrent processes in a java activity and synchronzied with a join activty.