ef METHOD_NAME( self, parent_units, use_copy_output = True ):
  """Create a chained unit using the output data from the given units"""
  # check all parent units for copy_output
  copy_output_ok = True
  for parent in parent_units:
     if not parent.copy_output:
        copy_output_ok = False
  # all parent units must be completed so the outputfiles are filled correctly
  for parent in parent_units:
     if parent.status != "completed":
       return None
  if len(parent_units) == 0:
     return None
  if not use_copy_output or not copy_output_ok:
     unit = ND280Unit()
     unit.inputdata = ND280LocalDataset()
     for parent in parent_units:
        # loop over the output files and add them to the ND280LocalDataset - THIS MIGHT NEED SOME WORK!
        job = GPI.jobs(parent.active_job_ids[0])
        # if TaskChainInput.include_file_mask is not used go old way (see below)
        # otherwise add all file matching include_file_mask(s) to the unit.inputdata. DV.
        inc_file_mask = False
        for p in self.inputdata[0].include_file_mask:
           unit.inputdata.get_dataset(job.outputdir, p)
           inc_file_mask = True
        if not inc_file_mask:
           for f in job.outputfiles:
              # should check for different file types and add them as appropriate to the dataset
              # self.inputdata (== TaskChainInput).include/exclude_file_mask could help with this
              # This will be A LOT easier with Ganga 6.1 as you can easily map outputfiles -> inputfiles!
              # TODO: implement use of include/exclude_file_mask
              #       
              try:
                 outputfilenameformat = f.outputfilenameformat
              except:
                 inputdir = job.outputdir
              else:
                 #### WARNING: The following will work only if the SharedFile puts the files in local directories !
                 inputdir = '/'.join([os.path.expanduser(os.path.expandvars(getConfig('Output')['SharedFile']['uploadOptions']['path'])), f.outputfilenameformat.replace('{fname}','')])
              unit.inputdata.get_dataset( inputdir, f.namePattern )
  else:
     unit = ND280Unit()
     unit.inputdata = ND280LocalDataset()
     for parent in parent_units:
        # unit needs to have completed and downloaded before we can get file list
        if parent.status != "completed":
           return None
        # we should be OK so copy all output to the dataset
        for f in parent.copy_output.files:
           unit.inputdata.names.append( os.path.join( parent.copy_output.local_location, f ) )
  return unit