private async Task <Boolean> ProcessEachLineAsync(ImportFileRecord importFileRecord) { Boolean retVal = false; try { if (importFileRecord != null) { int resourceGroupId = await WorkspaceQueryHelper.GetResourcePoolAsync(AgentHelper.GetServicesManager(), ExecutionIdentity.System, WorkspaceArtifactId); //get selected markup sub types in the import job List <int> selectedMarkupSubTypes = _markupUtilityImportJob .MarkupUtilityTypes .Select(x => MarkupTypeHelper.GetMarkupSubTypeValueAsync(x.Name).Result) .ToList(); //insert into import manager holding table only if the sub type is selected in the import job if (selectedMarkupSubTypes.Contains(importFileRecord.MarkupSubType)) { await QueryHelper.InsertRowIntoImportManagerHoldingTableAsync( AgentHelper.GetDBContext(-1), WorkspaceArtifactId, importFileRecord.DocumentIdentifier, importFileRecord.FileOrder, resourceGroupId, _markupUtilityImportJob.ArtifactId, _markupUtilityImportJob.MarkupSetArtifactId, _markupUtilityImportJob.JobType, importFileRecord, _markupUtilityImportJob.SkipDuplicateRedactions, ImportManagerHoldingTable); _expectedRedactionCount++; } retVal = true; } } catch (Exception ex) { throw new MarkupUtilityException("An error occured when inserting redaction record to the import manager holding table.", ex); } finally { _importFileRedactionCount++; if (_importFileRedactionCount % 100 == 0) { RaiseMessage($"Parsed {_importFileRedactionCount} records in import file."); } } return(retVal); }