cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to complete User task

kasit
Champ in-the-making
Champ in-the-making
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.
1 REPLY 1

trademak
Star Contributor
Star Contributor