cancel
Showing results for 
Search instead for 
Did you mean: 

deleting task produces an error

r3dge
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to delete a task :


List<Task> tasks = taskService.createTaskQuery().taskDefinitionKey(TaskTypeID).taskAssignee(userID).active().list();

for(Task task : tasks){
   taskService.deleteTask(task.getId());
}


And i get the following error message : "The task cannot be deleted because ispart of a running process".

I there a way to delete tasks that are in a user basket ?
2 REPLIES 2

trademak
Star Contributor
Star Contributor
When a task is part of a process it can't be deleted like this. You would need to either complete the task, delete the whole process instance or fire a signal event to cancel the task.

Best regards,

r3dge
Champ in-the-making
Champ in-the-making
ok, i understand, thank you.