AnsweredAssumed Answered

ActivitiException: userId is null after transferring task

Question asked by mindcrime on Mar 20, 2013
Latest reply on Mar 21, 2013 by mindcrime
Hey guys, using Activiti 5.10, I'm seeing some hard to explain weirdness.  If I, in Java code, transfer a UserTask
to a different user, doing something like this:

      List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("management").list();
      System.out.println( "for management: ");
      for( Task task : tasks )
         System.out.println( "task: " + task.toString() );

         taskService.setOwner(task.getId(), "gonzo" );
         taskService.setAssignee(task.getId(), "gonzo");


everything appears to work, initially.  No errors are thrown in the above code, and I can examine the task in the db table and
see the correct values for Owner and Assignee.  And if I login to Activiti Explorer as Gonzo, I now see the task in
my inbox.  But…  Gonzo can't actually do anything with the task (like, say, complete it).  Nothing happens if he clicks
on the Task item, and the following error is shown in the console when the page was originally rendered:

Caused by: org.activiti.engine.ActivitiException: userId is null
   at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(
   at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(
   at org.activiti.spring.SpringTransactionInterceptor.execute(
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(
   at org.activiti.engine.impl.IdentityServiceImpl.getUserPicture(
   at org.activiti.explorer.ui.task.TaskEventsPanel.addTaskEventPicture(
   at org.activiti.explorer.ui.task.TaskEventsPanel.addTaskEvents(
   at org.activiti.explorer.ui.task.TaskEventsPanel.refreshTaskEvents(
   at org.activiti.explorer.ui.task.TaskEventsPanel.setTaskId(
   at org.activiti.explorer.ui.task.TaskPage.createDetailComponent(
   at org.activiti.explorer.ui.task.TaskPage$1.valueChange(
   at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
   at java.lang.reflect.Method.invoke(
   at com.vaadin.event.ListenerMethod.receiveEvent(

Does anyone have any idea what's going on here?  Is there something I need to do differently when I transfer the Task?  Also, FYI, doing the
ownership change and assignment simultaneously is a business requirement.  They want the act of transferring a task to automatically assign
it to the new owner.