1 Reply Latest reply on Oct 8, 2007 6:56 AM by Ebrahim Salehi

    Whats the correct way to do task managment for a given actor

    Josh Long Newbie

      Here's what I envision:

      a process flow begins with a start state and carries on until it hits a task-node. The task node compels some sort of external actor (presumably a human being) to get the latest task instances and, going through each one, to start, stop it.

      However, no matter what i do i can't seem to get start() and end() to insert values into the database. Ive tried taskinstance.setEnd(new java.util.Date());

      ive tried making sure to save the task instance / process instance after each method call, and i continue to be disappointed. worse still, i dont know how to use ctx.getTaskMgmtSession().findTaskInstances to get only task instances that arent be already worked on (presumably this is all task instances with the same actorid whose start() method has been called).

      Essentially, I want to know how to make sure the same task never comes uup more than once. Thanks!

      Any help in clearning this up would be extroardinarily helpful, thanks.

        • 1. Re: Whats the correct way to do task managment for a given a
          Ebrahim Salehi Newbie

          Hi dude,
          Are you trying to end a taskInstance? If it is the case, call: myTaskInstance.end(). This method sets end date for current taskInstance and taskMgmtSession sees this task as ended and consequently won't bring this task as return value of tasMgmtSession.findTaskInsXXXX.
          If you want not to end the task just to set a flag indicating that the task has been viewed, set a localVariable on the task e.g. taskInstance.setVariableLocally(variableName, new Boolean(true)); For the next time you retrieve that task using taskMgmtSession.findTaskXXXX check whether it has been seen before or not using taskInstance.getVariableLocally(variableName);
          If this post couldn't help you please let me know what you are exactly looking for.
          With kind regards,
          Ebrahim Salehi.