@Override
    public List<TaskModel> getMappedTasks(TaskMapperContext taskMapperContext)
            throws TerminateWorkflowException {

        LOGGER.debug("TaskMapperContext {} in ForkJoinTaskMapper", taskMapperContext);

        WorkflowTask workflowTask = taskMapperContext.getWorkflowTask();
        Map<String, Object> taskInput = taskMapperContext.getTaskInput();
        WorkflowModel workflowModel = taskMapperContext.getWorkflowModel();
        int retryCount = taskMapperContext.getRetryCount();

        List<TaskModel> tasksToBeScheduled = new LinkedList<>();
        TaskModel forkTask = taskMapperContext.createTaskModel();
        forkTask.setTaskType(TaskType.TASK_TYPE_FORK);
        forkTask.setTaskDefName(TaskType.TASK_TYPE_FORK);
        long epochMillis = System.currentTimeMillis();
        forkTask.setStartTime(epochMillis);
        forkTask.setEndTime(epochMillis);
        forkTask.setInputData(taskInput);
        forkTask.setStatus(TaskModel.Status.COMPLETED);

        tasksToBeScheduled.add(forkTask);
        List<List<WorkflowTask>> forkTasks = workflowTask.getForkTasks();
        for (List<WorkflowTask> wfts : forkTasks) {
            WorkflowTask wft = wfts.get(0);
            List<TaskModel> tasks2 =
                    taskMapperContext
                            .getDeciderService()
                            .getTasksToBeScheduled(workflowModel, wft, retryCount);
            tasksToBeScheduled.addAll(tasks2);
        }

        WorkflowTask joinWorkflowTask =
                workflowModel
                        .getWorkflowDefinition()
                        .getNextTask(workflowTask.getTaskReferenceName());

        if (joinWorkflowTask == null || !joinWorkflowTask.getType().equals(TaskType.JOIN.name())) {
            throw new TerminateWorkflowException(
                    "Fork task definition is not followed by a join task.  Check the blueprint");
        }
        List<TaskModel> joinTask =
                taskMapperContext
                        .getDeciderService()
                        .getTasksToBeScheduled(workflowModel, joinWorkflowTask, retryCount);

        tasksToBeScheduled.addAll(joinTask);
        return tasksToBeScheduled;
    }
This method gets the list of tasks that need to scheduled when the task to scheduled is of
type {@link TaskType#FORK_JOIN}.

@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#TASK_TYPE_FORK} with {@link TaskModel.Status#COMPLETED}
      <li>Might be any kind of task, but in most cases is a UserDefinedTask with {@link
          TaskModel.Status#SCHEDULED}
    </ul>

@throws TerminateWorkflowException When the task after {@link TaskType#FORK_JOIN} is not a
    {@link TaskType#JOIN}
core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java