@Override
  public void dispatch (TaskExecution aTask) {
    List<MapObject> tasks = aTask.getList("tasks", MapObject.class);
    Assert.notNull(tasks,"'tasks' property can't be null");
    if(tasks.size() > 0) {
      counterRepository.set(aTask.getId(), tasks.size());
      for(Map<String,Object> task : tasks) {
        SimpleTaskExecution parallelTask = SimpleTaskExecution.of(task);
        parallelTask.setId(UUIDGenerator.generate());
        parallelTask.setParentId(aTask.getId());
        parallelTask.setStatus(TaskStatus.CREATED);
        parallelTask.setJobId(aTask.getJobId());
        parallelTask.setCreateTime(new Date());
        parallelTask.setPriority(aTask.getPriority());
        MapContext context = new MapContext (contextRepository.peek(aTask.getId()));
        contextRepository.push(parallelTask.getId(), context);
        taskExecutionRepo.create(parallelTask);
        taskDispatcher.dispatch(parallelTask);
      }
    }
    else {
      SimpleTaskExecution completion = SimpleTaskExecution.of(aTask);
      completion.setEndTime(new Date());
      messageBroker.send(Queues.COMPLETIONS, completion);
    }
  }
A {@link TaskDispatcher} implementation which implements the parallel
construct. Providing a list of <code>tasks</code> the dispatcher will 
execute these in parallel. As each task is complete it will be caught
by the {@link ParallelTaskCompletionHandler}. 

@author Arik Cohen
@since May 12, 2017
src/main/java/com/creactiviti/piper/core/task/ParallelTaskDispatcher.java