2 Replies Latest reply on Apr 23, 2006 3:46 AM by koen.aers

    ProcessInstance.resume() not working

    nsobti

      Hi all,

      I suspended a ProcessInstance in an ActionHandler of a node using the following code:

      public void execute( ExecutionContext executionContext ) throws Exception{
       executionContext.getProcessInstance().suspend();
      }


      I checked the database - JBPM_PROCESSINSTANCE table, and ISSUSPENDED_ for this instance was '1'.

      However, when I try to resume this instance elsewhere, using,
      instance.resume();


      I do see the ISSUSPENDED_ change to 0, but it does not resume the workflow. Before calling instance.resume(), I tried to print out the node that the instance was in, and it was in the same state where it left off.

      Please advise.

      Thanks.

        • 1. Re: ProcessInstance.resume() not working
          nsobti

          Also, I forgot to mention that the instance was suspended in an Exception Handler. Could that be the reason why it is not able to resume execution?

          I could resume the execution using the following code, though:

          instance.resume();
           instance.signal(((Transition[])instance.getRootToken().getNode().getArrivingTransitions().toArray(new Transition[0]))[0]);


          Is this the best and only way to assume execution of a suspended instance?

          Thanks.

          • 2. Re: ProcessInstance.resume() not working
            koen.aers

            Yes this is the way you should do it.

            Regards,
            Koen