03-20-2013 03:28 PM
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");
}
Caused by: org.activiti.engine.ActivitiException: userId is null
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:39)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:28)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.IdentityServiceImpl.getUserPicture(IdentityServiceImpl.java:102)
at org.activiti.explorer.ui.task.TaskEventsPanel.addTaskEventPicture(TaskEventsPanel.java:134)
at org.activiti.explorer.ui.task.TaskEventsPanel.addTaskEvents(TaskEventsPanel.java:127)
at org.activiti.explorer.ui.task.TaskEventsPanel.refreshTaskEvents(TaskEventsPanel.java:93)
at org.activiti.explorer.ui.task.TaskEventsPanel.setTaskId(TaskEventsPanel.java:102)
at org.activiti.explorer.ui.task.TaskPage.createDetailComponent(TaskPage.java:132)
at org.activiti.explorer.ui.task.TaskPage$1.valueChange(TaskPage.java:116)
at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
03-20-2013 03:34 PM
List<Task> gonzoTasks = taskService.createTaskQuery().taskOwner("gonzo").list();
System.out.println( "for gonzo: ");
for( Task task : gonzoTasks )
{
System.out.println( "task: " + task.toString() );
System.out.println( "Owner: " + task.getOwner() );
System.out.println( "Assignee: " + task.getAssignee());
}
for gonzo:
task: Task[6311]
Owner: gonzo
Assignee: gonzo
03-20-2013 03:44 PM
List<Task> gonzoTasks = taskService.createTaskQuery().taskOwner("gonzo").list();
System.out.println( "for gonzo: ");
for( Task task : gonzoTasks )
{
System.out.println( "task: " + task.toString() );
System.out.println( "Owner: " + task.getOwner() );
System.out.println( "Assignee: " + task.getAssignee());
taskService.complete(task.getId());
}
Caused by: org.activiti.engine.ActivitiException: userId is null
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:39)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:28)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.IdentityServiceImpl.getUserPicture(IdentityServiceImpl.java:102)
at org.activiti.explorer.ui.task.TaskEventsPanel.addTaskEventPicture(TaskEventsPanel.java:134)
at org.activiti.explorer.ui.task.TaskEventsPanel.addTaskEvents(TaskEventsPanel.java:127)
at org.activiti.explorer.ui.task.TaskEventsPanel.refreshTaskEvents(TaskEventsPanel.java:93)
at org.activiti.explorer.ui.task.TaskEventsPanel.setTaskId(TaskEventsPanel.java:102)
at org.activiti.explorer.ui.task.ArchivedPage.createDetailComponent(ArchivedPage.java:55)
at org.activiti.explorer.ui.task.TaskPage$1.valueChange(TaskPage.java:116)
at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
… 46 more
03-21-2013 04:17 AM
Caused by: org.activiti.engine.ActivitiException: userId is null
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:39)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:28)
taskService.setOwner(task.getId(), "gonzo" );
taskService.setAssignee(task.getId(), "gonzo");
03-21-2013 10:51 AM
Looks like the person who cause the event (set the owner) is null.Caused by: org.activiti.engine.ActivitiException: userId is null
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:39)
at org.activiti.engine.impl.cmd.GetUserPictureCmd.execute(GetUserPictureCmd.java:28)
Try adding Authentication.setUser (or currentUser, not sure what the exact syntax is) before setting the owner and assignee. This way, explorer will be able to render an image for the event.
However, it's an issue that in case of null-userid, an exception is thrown. Can you file a jIra for this issue perhaps?
taskService.setOwner(task.getId(), "gonzo" );
taskService.setAssignee(task.getId(), "gonzo");
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.