@Override
    public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext) {
        LOGGER.debug("TaskMapperContext {} in DecisionTaskMapper", taskMapperContext);
        List<TaskModel> tasksToBeScheduled = new LinkedList<>();
        WorkflowTask workflowTask = taskMapperContext.getWorkflowTask();
        WorkflowModel workflowModel = taskMapperContext.getWorkflowModel();
        Map<String, Object> taskInput = taskMapperContext.getTaskInput();
        int retryCount = taskMapperContext.getRetryCount();

        // get the expression to be evaluated
        String caseValue = getEvaluatedCaseValue(workflowTask, taskInput);

        // QQ why is the case value and the caseValue passed and caseOutput passes as the same ??
        TaskModel decisionTask = taskMapperContext.createTaskModel();
        decisionTask.setTaskType(TaskType.TASK_TYPE_DECISION);
        decisionTask.setTaskDefName(TaskType.TASK_TYPE_DECISION);
        decisionTask.addInput("case", caseValue);
        decisionTask.addOutput("caseOutput", Collections.singletonList(caseValue));
        decisionTask.setStartTime(System.currentTimeMillis());
        decisionTask.setStatus(TaskModel.Status.IN_PROGRESS);
        tasksToBeScheduled.add(decisionTask);

        // get the list of tasks based on the decision
        List<WorkflowTask> selectedTasks = workflowTask.getDecisionCases().get(caseValue);
        // if the tasks returned are empty based on evaluated case value, then get the default case
        // if there is one
        if (selectedTasks == null || selectedTasks.isEmpty()) {
            selectedTasks = workflowTask.getDefaultCase();
        }
        // once there are selected tasks that need to proceeded as part of the decision, get the
        // next task to be scheduled by using the decider service
        if (selectedTasks != null && !selectedTasks.isEmpty()) {
            WorkflowTask selectedTask =
                    selectedTasks.get(0); // Schedule the first task to be executed...
            // TODO break out this recursive call using function composition of what needs to be
            // done and then walk back the condition tree
            List<TaskModel> caseTasks =
                    taskMapperContext
                            .getDeciderService()
                            .getTasksToBeScheduled(
                                    workflowModel,
                                    selectedTask,
                                    retryCount,
                                    taskMapperContext.getRetryTaskId());
            tasksToBeScheduled.addAll(caseTasks);
            decisionTask.addInput("hasChildren", "true");
        }
        return tasksToBeScheduled;
    }
This method gets the list of tasks that need to scheduled when the task to scheduled is of
type {@link TaskType#DECISION}.

@param taskMapperContext: A wrapper class containing the {@link WorkflowTask}, {@link
    WorkflowDef}, {@link WorkflowModel} and a string representation of the TaskId
@return List of tasks in the following order:
    <ul>
      <li>{@link TaskType#DECISION} with {@link TaskModel.Status#IN_PROGRESS}
      <li>List of task based on the evaluation of {@link WorkflowTask#getCaseExpression()}
          are scheduled.
      <li>In case of no matching result after the evaluation of the {@link
          WorkflowTask#getCaseExpression()}, the {@link WorkflowTask#getDefaultCase()} Tasks
          are scheduled.
    </ul>
core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java