private void addTaskToQueue(final List<TaskModel> tasks) {
        for (TaskModel task : tasks) {
            addTaskToQueue(task);
            // notify TaskStatusListener
            try {
                taskStatusListener.onTaskScheduled(task);
            } catch (Exception e) {
                String errorMsg =
                        String.format(
                                "Error while notifying TaskStatusListener: %s for workflow: %s",
                                task.getTaskId(), task.getWorkflowInstanceId());
                LOGGER.error(errorMsg, e);
            }
        }
    }
Gets the active domain from the list of domains where the task is to be queued. The domain
list must be ordered. In sequence, check if any worker has polled for last
`activeWorkerLastPollMs`, if so that is the Active domain. When no active domains are found:
<li>If NO_DOMAIN token is provided, return null.
<li>Else, return last domain from list.

@param taskType the taskType of the task for which active domain is to be found
@param domains the array of domains for the task. (Must contain atleast one element).
@return the active domain where the task will be queued
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java