code: def generate_output_prov(self,
                               final_output,    # type: Dict[Text, Any]
                               process_run_id,  # type: Optional[str]
                               name             # type: Optional[Text]
                              ):   # type: (...) -> None
          
          # Timestamp should be created at the earliest
          timestamp = datetime.datetime.now()
  
          # For each output, find/register the corresponding
          # entity (UUID) and document it as generated in
          # a role corresponding to the output
          for output, value in final_output.items():
              entity = self.declare_artefact(value)
              if name is not None:
                  name = urllib.parse.quote(str(name), safe=":/,#")
                  # FIXME: Probably not "main" in nested workflows
                  role = self.wf_ns["main/%s/%s" % (name, output)]
              else:
                  role = self.wf_ns["main/%s" % output]
  
              if not process_run_id:
                  process_run_id = self.workflow_run_uri
  
              self.document.wasGeneratedBy(
                  entity, process_run_id, timestamp, None, {"prov:role": role})
docs: Call wasGeneratedBy() for each output,copy the files into the RO.