private void initializeTasks(String service, List<Task> tasks) {
      if (CollectionUtils.isEmpty(tasks)) {
        return;
      }

      for (Task task : tasks) {
        if (Task.Type.CONFIGURE == task.getType()) {
          ((ConfigureTask) task).associatedService = service;
        } else if (Task.Type.CREATE_AND_CONFIGURE == task.getType()) {
          ((CreateAndConfigureTask) task).associatedService = service;
        }
      }
    }
Checks for config tasks and marks the associated service.
@param service
         the service name
@param tasks
         the list of tasks to check
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java