AnsweredAssumed Answered

Error while getting identity links

Question asked by partizano on Nov 22, 2011
Latest reply on Nov 23, 2011 by partizano
Hi!

I have process like this:
[attachment=0]MyProcess2211.png[/attachment]

UserTask has the following taskListener on "create" event:
public class CreateTaskListener implements TaskListener {

   private static ProcessEngine processEngine = ActivitiEngine.getInstance();
   private static final Logger log = Logger.getLogger(CreateTaskListener.class.toString());

   public void notify(DelegateTask task) {
      List<String> taskGroups = new ArrayList<String>();
      List<IdentityLink> identityLinks = processEngine.getTaskService().getIdentityLinksForTask(task.getId());
      for (IdentityLink identityLink : identityLinks) {
         if (identityLink.getType().equals(IdentityLinkType.CANDIDATE)) {
            taskGroups.add(identityLink.getGroupId());
         }
      }
      log.info(identityLinks.size());
   }
}

After process is started the following error occurs:
22.11.2011 11:15:01 org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
java.lang.NullPointerException
   at org.activiti.engine.impl.cmd.GetIdentityLinksForTaskCmd.execute(GetIdentityLinksForTaskCmd.java:46)
   at org.activiti.engine.impl.cmd.GetIdentityLinksForTaskCmd.execute(GetIdentityLinksForTaskCmd.java:30)
   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.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.TaskServiceImpl.getIdentityLinksForTask(TaskServiceImpl.java:135)
   at com.myCompany.CreateTaskListener.notify(CreateTaskListener.java:30)
   at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34)
   at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
   at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
   at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:90)
   at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(TaskListenerInvocation.java:34)
   at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
   at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
   at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:512)
   at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.execute(UserTaskActivityBehavior.java:70)
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
        ….

Is this a bug?

Attachments

Outcomes