Sun Java System Portal Server 7.2 Developer's Guide

Completing a Task

Once you check out a task and modify the attributes, you may want to mark the status of a task as completed. This marking is called completing a task.

To complete a task, add the following method to a class:


private com.sun.saw.vo.OutputVO completeTasks(String userId,java.util.List taskIdList,
com.sun.saw.Workflow workflowImpl) throws com.sun.saw.WorkflowException {

    com.sun.saw.vo.OutputVO outputVO = null;
    com.sun.saw.vo.CompleteTaskVO completeTaskVO = new com.sun.saw.vo.CompleteTaskVO();
    completeTaskVO.setTaskIdList(taskIdList);
    completeTaskVO.setUserId(userId);

    outputVO = workflowImpl.completeTasks(completeTaskVO);
    return outputVO;

  }
//Call the above method from your main(). For example,.
client.completeTasks("CPina", taskIdList,workflowImpl);

The task is marked as completed.