use of org.camunda.bpm.engine.impl.persistence.entity.TaskManager in project camunda-bpm-platform by camunda.
the class ClaimTaskCmd method execute.
public Void execute(CommandContext commandContext) {
ensureNotNull("taskId", taskId);
TaskManager taskManager = commandContext.getTaskManager();
TaskEntity task = taskManager.findTaskById(taskId);
ensureNotNull("Cannot find task with id " + taskId, "task", task);
checkClaimTask(task, commandContext);
if (userId != null) {
if (task.getAssignee() != null) {
if (!task.getAssignee().equals(userId)) {
// this, post-conditions of method already met.
throw new TaskAlreadyClaimedException(task.getId(), task.getAssignee());
}
} else {
task.setAssignee(userId);
}
} else {
// Task should be assigned to no one
task.setAssignee(null);
}
task.createHistoricTaskDetails(UserOperationLogEntry.OPERATION_TYPE_CLAIM);
return null;
}
use of org.camunda.bpm.engine.impl.persistence.entity.TaskManager in project camunda-bpm-platform by camunda.
the class DelegateTaskCmd method execute.
public Object execute(CommandContext commandContext) {
ensureNotNull("taskId", taskId);
TaskManager taskManager = commandContext.getTaskManager();
TaskEntity task = taskManager.findTaskById(taskId);
ensureNotNull("Cannot find task with id " + taskId, "task", task);
checkDelegateTask(task, commandContext);
task.delegate(userId);
task.createHistoricTaskDetails(UserOperationLogEntry.OPERATION_TYPE_DELEGATE);
return null;
}
Aggregations