2 Replies Latest reply on Oct 1, 2012 6:51 AM by Rahul Agrawal

    Release task in LocalTaskService in jBPM5.2

    Rahul Agrawal Newbie

      Hi all,

       

      This is my use case: A task is pending with a Role. Some user with that role claims the task. Now the user do not want to work on that task. He want to release that task to role pool.

       

      The above action can be achieved through org.jbpm.task.TaskService.release(taskId, idRef). But unfortunately this API is not working.

       

      So I dug dip into the code details ,I could find the following in the LocalTaskService

       

      public void release(long taskId, String userId) {

              taskServiceSession.taskOperation(Operation.Release, taskId, userId, null, null, null);

          }

       

      and in the TaskServiceSession for this taskOperation

       

                     switch (operation) {

                      case Claim: {

                          taskClaimOperation(task);

                          break;

                      }

                      case Complete: {

                          taskCompleteOperation(task, data);

                          break;

                      }

                      case Fail: {

                          taskFailOperation(task, data);

                          break;

                      }

                      case Skip: {

                          taskSkipOperation(task, userId);

                          break;

                      }

                      case Remove: {

                                taskRemoveOperation(task, user);

                                break;

                      }

                      case Register: {

                                taskRegisterOperation(task, user);

                                break;

                      }

                  }

      there is no switch case for release operation. The same for the postTaskOperations.

       

       

      Can anyone explain? Am I not supposed to use release for the use case above described?

      Please help!!!