4 Replies Latest reply on Nov 4, 2011 2:58 AM by jeffery jeffery

    [jbpm5] how to restart a completed usertask

    jeffery jeffery Newbie


      I have a question about how to restart a completed usertask.

      It means  when a usertask is completed,its status is 'completed' in database.

      In my javacode,I got the completed usertask by taskid.


         BlockingTaskSummaryResponseHandler taskSummaryHandler = new BlockingTaskSummaryResponseHandler();

         BlockingGetTaskResponseHandler response = new BlockingGetTaskResponseHandler();

         taskClient.getTask(8, response);

         Task task1 = response.getTask();



      then I tried to start the task again.......


         BlockingTaskOperationResponseHandler taskOperationHandler = new BlockingTaskOperationResponseHandler();
         taskClient.start(task1.getId(), "john", taskOperationHandler);


      but exception occured:



      org.jbpm.task.service.PermissionDeniedException: Server-side Exception: User '[User:'john']' was unable to execution operation 'Start' on task id 8 due to no 'current status' matchines

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

      at java.lang.reflect.Constructor.newInstance(Unknown Source)

      at org.jbpm.task.service.responsehandlers.AbstractBaseResponseHandler.createSideException(AbstractBaseResponseHandler.java:74)

      at org.jbpm.task.service.responsehandlers.AbstractBlockingResponseHandler.waitTillDone(AbstractBlockingResponseHandler.java:48)

      at RollBaskTest.main(RollBaskTest.java:105)




      because the status was not 'Reserved' so I counld not use the method start() to restart it.


      is there anyway to change the completed usertask's status(from completed to reserved)


      Looking forward for your guidance.

      Thank you!