I am in the process of upgrading to version 5.9 of the plugin, and am using version 5.11 of the activiti engine.
I have discovered that whenever I call
deleteTask(params.taskId) I get this error:
org.activiti.engine.ActivitiException: The task cannot be deleted because is part of a running process
at org.activiti.engine.impl.persistence.entity.TaskManager.deleteTask(TaskManager.java:138)...
I have found that I can delete the process instance instead like this:
def task = ActivitiUtils.taskService.createTaskQuery().taskId(params.taskId).singleResult()
ActivitiUtils.getRuntimeService().deleteProcessInstance(task.getProcessInstanceId(), "canceled")
The deletion is needed when a user kicks of a workflow and then cancels it. If anyone has any insight into why deleteTask is no longer working for me, I'd be interested.