AnsweredAssumed Answered

How to set the owner of a task?

Question asked by bbarani on Feb 26, 2013
Latest reply on Apr 18, 2013 by jbarrez
Hi,

I have a simple workflow with custom form.

I figured out a way to set the owner of the task and it seems to work fine..

public class ArchiveTask implements org.activiti.engine.delegate.JavaDelegate

{
   public void execute(DelegateExecution execution) throws Exception {
      String assigneeName = (String) execution.getVariable("user");
      TaskService taskService = execution.getEngineServices()
            .getTaskService();
      List<Task> tasks = taskService.createTaskQuery()
            .taskAssignee(assigneeName).list();
      for (Task task : tasks) {
         task.setOwner(assigneeName);
      }

   }
}

Can someone let me know if I am right?


Thanks,
Barani

Outcomes