boolean markTaskFailure(TaskModel taskModel, TaskModel.Status status, String failureReason) {
        LOGGER.error("Marking task {} failed with error.", taskModel.getTaskId());
        taskModel.setReasonForIncompletion(failureReason);
        taskModel.setStatus(status);
        return true;
    }
Check if all tasks in the current iteration have reached terminal state.

@param doWhileTaskModel The {@link TaskModel} of DO_WHILE.
@param referenceNameToModel Map of taskReferenceName to {@link TaskModel}.
@return true if all tasks in DO_WHILE.loopOver are in <code>referenceNameToModel</code> and
    reached terminal state.
core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java