Quintiq file version 2.0
#parent: #root
Method ImportFiles (
  structured[BaseImportObjectGroupInProfile] importobjectgroupinprofile,
  output owning structured[BinaryValue] binaryvalues,
  output structured[String] brokers
) id:Method_DialogUserImportProfile_ImportFiles
{
  #keys: '[132894.0.197614378]'
  Body:
  [*
    // Import files from client side and read into binary
    traverse( importobjectgroupinprofile, Elements, e )
    {
      filenames := e.ImportObjectGroup().GetMPSyncFileNames();
    
      traverse( filenames, Elements, filename )
      {
        filepath := e.BaseImportProfile().ExcelPath() + filename;
    
        if( Application.ClientFileExists( filepath ) )
        {
          bindata := Application.ReadBinaryFile( filepath );
          brokername := Dialog.GetBrokerName( filename );
    
          binaryvalues.Add( bindata.AsBinaryValue() );
    
          if ( brokername.Length() > 0 )
          {
            brokers.Add( brokername );
          }
        }
      }
    }
  *]
}
