Guys,
When a user task completes using TaskService.completeTask method, as I can see in class TaskEntity:
public void complete() {
// if the task is associated with a case
// execution then call complete on the
// associated case execution. The case
// execution handles the completion of
// the task.
if (caseExecutionId != null) {
getCaseExecution().manualComplete();
return;
}
// in the other case:
// ensure the the Task is not suspended
ensureTaskActive();
// trigger TaskListener.complete event
fireEvent(TaskListener.EVENTNAME_COMPLETE);
// delete the task
Context
.getCommandContext()
.getTaskManager()
.deleteTask(this, TaskEntity.DELETE_REASON_COMPLETED, false);
// if the task is associated with a
// execution (and not a case execution)
// then call signal an the associated
// execution.
if (executionId!=null) {
ExecutionEntity execution = getExecution();
execution.removeTask(this);
execution.signal(null, null);
}
}
But when delete TaskService.deleteTask is called, there is not signaling, as I can see in same class TaskEntity:
public void delete(String deleteReason, boolean cascade) {
this.deleteReason = deleteReason;
fireEvent(TaskListener.EVENTNAME_DELETE);
Context
.getCommandContext()
.getTaskManager()
.deleteTask(this, deleteReason, cascade);
if (executionId != null) {
ExecutionEntity execution = getExecution();
execution.removeTask(this);
}
}
My question is: what happens to process instance when a user task is canceled from within using TaskService.deleteTask?
Cristian