private void notifyTaskStatusListener(TaskModel task) {
        switch (task.getStatus()) {
            case COMPLETED:
                taskStatusListener.onTaskCompleted(task);
                break;
            case CANCELED:
                taskStatusListener.onTaskCanceled(task);
                break;
            case FAILED:
                taskStatusListener.onTaskFailed(task);
                break;
            case FAILED_WITH_TERMINAL_ERROR:
                taskStatusListener.onTaskFailedWithTerminalError(task);
                break;
            case TIMED_OUT:
                taskStatusListener.onTaskTimedOut(task);
                break;
            case IN_PROGRESS:
                taskStatusListener.onTaskInProgress(task);
                break;
            case SCHEDULED:
                // no-op, already done in addTaskToQueue
            default:
                break;
        }
    }
@param taskResult the task result to be updated.
@throws IllegalArgumentException if the {@link TaskResult} is null.
@throws NotFoundException if the Task is not found.
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java