AnsweredAssumed Answered

Not able to complete User task

Question asked by kasit on Apr 25, 2013
Latest reply on Apr 29, 2013 by trademak
I am trying to complete a user task for which fozzie is the assignee.
The code is :

TaskService taskService = processEngine.getTaskService();
List<Task> tasks = taskService.createTaskQuery().taskAssignee(user?.username)?.list();
taskService.complete(tasks.get(0).getId(),variables);

But exception occurrs as follows :

rg.activiti.engine.ActivitiException: Provided id is null

   at org.activiti.engine.impl.UserQueryImpl.userId(UserQueryImpl.java:53)

   at Script1.run(Script1.groovy:4)

   at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:315)

   at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111)

   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:216)

I tried
IdentityService identityService = processEngine.getIdentityService();
identityService.setAuthenticatedUserId("fozzie")
But it does not work.
I guess i am unable to create a session with user as fozzie.

Can you please help in this regard.

Outcomes