2 Replies Latest reply on Aug 17, 2006 9:27 AM by cpob

    Release the task when session Timeout and close the browser

    tom_sri74

      Hi,

      When I click Cancel Button in JSF it's call the below method

      public String cancelTask(){
      TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(taskVO.getTaskInstanceId());
      taskInstance.setActorId(null);
      graphSession.saveProcessInstance(taskInstance.getTaskMgmtInstance().getProcessInstance());

      return "summary";
      }


      The above code sets the "ActorId" to "null" for a particular task thus releasing it (in JBPM database).

      My doubt is

      The code in blue has to be replicated for all the tasks which are tied to a user during:

      (1) Session Timeout
      (2) Browser Close/Exit

      when the page session timeout or user click to close the browser
      how to Actorid set to null

      Please tell me the solution regarding the above.

      Thanks and regards
      Sri

        • 1. Re: Release the task when session Timeout and close the brow
          newbie007

          Why you want to set the actor id to null when user closes the browser or session timeout?

          I don't think session timeout is same as cancelling a task. Just imagine a scenario where you are working on a task and you are out for say 5 minutes and when you come back, the task is not there in your list because session timeout nullifying the user.

          Hope that helps.

          Thanks.

          • 2. Re: Release the task when session Timeout and close the brow
            cpob

            You could rely instead of a jBPM timer in general for a cancellation/reassigning. You could give a user 1 day to do something, otherwise it's gone.

            It's not particularly fair to kill something for a user if his browser closes. Maybe his computer crashed, his network dropped, accidentally clicked on an external link, or closed the window.