# File lib/openshift-origin-controller/app/models/application.rb, line 1458
  def elaborate_descriptor
    self.group_instance_map = {} if group_instance_map.nil?
    self.comp_instance_map = {} if comp_instance_map.nil?
    self.working_comp_inst_hash = {}
    self.working_group_inst_hash = {}
    self.group_override_map = {}
    self.conn_endpoints_list = []
    default_profile = @profile_name_map[@default_profile]

    default_profile.groups.each { |g|
      #gpath = self.name + "." + g.name
      gpath = self.get_name_prefix + g.get_name_prefix
      gi = working_group_inst_hash[gpath]
      if gi.nil?
        gi = self.group_instance_map[gpath]
        if gi.nil?
          gi = GroupInstance.new(self, self.name, self.default_profile, g.name, gpath)
        else
          gi.merge(self.name, self.default_profile, g.name, gpath)
        end
      else
        gi.merge(self.name, self.default_profile, g.name, gpath)
      end
      self.group_instance_map[gpath] = gi
      self.working_group_inst_hash[gpath] = gi
      gi.elaborate(default_profile, g, self.get_name_prefix, self)
    }

    # make connection_endpoints out of provided connections
    default_profile.connections.each { |conn|
      inst1 = ComponentInstance::find_component_in_cart(default_profile, self, conn.components[0], self.get_name_prefix)
      inst2 = ComponentInstance::find_component_in_cart(default_profile, self, conn.components[1], self.get_name_prefix)
      ComponentInstance::establish_connections(inst1, inst2, self)
    }
    # check self.comp_instance_map for component instances
    # check self.group_instance_map for group instances
    # check self.conn_endpoints_list for list of connection endpoints (fully resolved)

    # resolve group co-locations
    colocate_groups

    # get configure_order and start_order
    get_exec_order(default_profile)

    deleted_components_list = []
    self.comp_instance_map.each { |k,v| deleted_components_list << k if self.working_comp_inst_hash[k].nil?  }

    yield deleted_components_list if block_given?

    # delete entries in {group,comp}_instance_map that do
    # not exist in working_{group,comp}_inst_hash
    self.group_instance_map.delete_if { |k,v|
      v.component_instances.delete(k) if self.working_comp_inst_hash[k].nil? and v.component_instances.include?(k)
      self.working_group_inst_hash[k].nil?
    }
    self.comp_instance_map.delete_if { |k,v| self.working_comp_inst_hash[k].nil?  }
  end