@VisibleForTesting
    void setTaskDomains(List<TaskModel> tasks, WorkflowModel workflow) {
        Map<String, String> taskToDomain = workflow.getTaskToDomain();
        if (taskToDomain != null) {
            // Step 1: Apply * mapping to all tasks, if present.
            String domainstr = taskToDomain.get("*");
            if (StringUtils.isNotBlank(domainstr)) {
                String[] domains = domainstr.split(",");
                tasks.forEach(
                        task -> {
                            // Filter out SystemTask
                            if (!systemTaskRegistry.isSystemTask(task.getTaskType())) {
                                // Check which domain worker is polling
                                // Set the task domain
                                task.setDomain(getActiveDomain(task.getTaskType(), domains));
                            }
                        });
            }
            // Step 2: Override additional mappings.
            tasks.forEach(
                    task -> {
                        if (!systemTaskRegistry.isSystemTask(task.getTaskType())) {
                            String taskDomainstr = taskToDomain.get(task.getTaskType());
                            if (taskDomainstr != null) {
                                task.setDomain(
                                        getActiveDomain(
                                                task.getTaskType(), taskDomainstr.split(",")));
                            }
                        }
                    });
        }
    }
@param workflowId the id of the workflow
@param taskReferenceName the referenceName of the task to be skipped
@param skipTaskRequest the {@link SkipTaskRequest} object
@throws IllegalStateException
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java