cancel
Showing results for 
Search instead for 
Did you mean: 

Set Owner of a User Task

sarkar92
Champ in-the-making
Champ in-the-making
I am trying to add owner of a user task…

 <userTask id="usertask1" name="GroupMembership Request" activiti:assignee="${assignee}" activiti:owner="${owner}">

Please tell me what I am trying in above  is it right?
4 REPLIES 4

sarkar92
Champ in-the-making
Champ in-the-making
anyone aware about this??
is there a way to add "owner" of any process. I am using Activiti REST

sarkar92
Champ in-the-making
Champ in-the-making
I got a solution form a thread but it gives an error.

I am using activiti 5.9


import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.activiti.engine.task.Task;

import com.sysvana.provisioning.ProvisioningServices;
import com.sysvana.provisioning.ProvisioningServicesProxy;
import com.sysvana.request.Group;
import com.sysvana.request.RequestServices;
import com.sysvana.request.RequestServicesProxy;


public class CreateAssigneeList implements JavaDelegate  {

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

it gives an error in the highlighted line….
is there anything wrog in my code??
please help

sarkar92
Champ in-the-making
Champ in-the-making
please help . I am using activiti 5.9

jignesh11
Champ in-the-making
Champ in-the-making
I commenting just because I found solution to this question. It will help anyone interested in doing this by Activit rest 5.13.

PUT runtime/tasks/{taskId}

with JSON body
{
  "owner" : "owner"
}