I have a process with a single task.
For some reason I want to delete the task/process.
What will be the preferred way?
If I delete the process with :
runtimeService.deleteProcessInstance(processInstanceId, deleteReson) ;
the deletion is successful.
But when I try the following code :
taskService.deleteTask(taskId);
I got the following error :
org.activiti.engine.ActivitiException: The task cannot be deleted because is part of a running process.
So, what is the difference between these two?
and also, when can I use taskService.deleteTask(taskId) ?