| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod Execute ( | 
|   UserImportProfiles userImportProfiles, | 
|   Boolean isRefreshFromSource, | 
|   Boolean isOverwriteManualConfig, | 
|   MacroPlan macroPlan, | 
|   MPSync mpsync, | 
|   ImportProfileExcel importObj | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     // 1. Get sorted set | 
|     datasourceFiles := selectsortedset( userImportProfiles, | 
|                                         Elements.GlobalImportProfileExcel.LibSOPImpExp_DataSource.LibSOPImpExp_DataSourceFile, | 
|                                         e,  | 
|                                         not isnull( e.LibSOPImpExp_ImportUploadedFile() ), | 
|                                         e.FileName() ); | 
|      | 
|     // 2. Get mpsync broker names & file data | 
|     binaryValues := selectvalues( datasourceFiles, Elements.LibSOPImpExp_ImportUploadedFile, upload,true, upload.DataAsBinary() ); | 
|     brokers := selectvalues( datasourceFiles, Elements, e, true, e.MPSyncBrokerName() ); | 
|      | 
|     // 3. Get unique import object groups | 
|     uniqueimportobjectgroups := BaseImportProfile::GetUniqueImportObjectGroupInProfiles( userImportProfiles ); | 
|      | 
|     // 4. Batch execute user import profiles | 
|     // Note: Use reactive quill to chain import object status & visualize the import progress in Web (progress bar & notification) | 
|     ex := importObj | 
|     ->SetStatusInProgress() // Set to status : In Progress | 
|     ->|mpsync->ExecuteUserImportProfiles( macroPlan, | 
|                                           userImportProfiles, | 
|                                           uniqueimportobjectgroups, | 
|                                           isRefreshFromSource, | 
|                                           isOverwriteManualConfig, | 
|                                           binaryValues, brokers ) | 
|     ->|importObj->SetStatusDone() // Set to status : Done | 
|     ->|macroPlan->SetLastImportTime() | 
|     ->Exception(); | 
|      | 
|     importObj->OnException( ex ); | 
|   *] | 
| } |