AnsweredAssumed Answered

TaskService.createAttachment requires taskID?

Question asked by davidk1 on Dec 6, 2012
Latest reply on Jan 6, 2013 by ronald.van.kuijk
Hi,

after upgrading from 5.10 to 5.11 my code stops running.

When calling method taskService.createAttachment(   "xx",
                  null,
                  instanceID,
                  "Letter",
                  "-",
                  "http://server");

I get now the exception:

6.12.2012 21:03:24 org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engine.ActivitiException: taskId is null
        at org.activiti.engine.impl.cmd.NeedsActiveTaskCmd.execute(NeedsActiveTaskCmd.java:42)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterce
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
        at org.activiti.engine.impl.TaskServiceImpl.createAttachment(TaskServiceImpl.java:279)
        at vf.service.CreateLiveDocListener.notify(CreateLiveDocListener.java:41)

……
   
I cannot find any method to retrieve the taskID from context:

public class CreateLiveDocListener implements ExecutionListener {
   public void notify(DelegateExecution execution) throws Exception {

   }
}

Regards

Outcomes