/// <summary> /// Absorb the boot parameters, deserialize and pass on the messages to the Search Worker /// </summary> public void DoBeginWork(string bootParameter) { bootParameter.ShouldNotBeEmpty(); // Deserialize and determine the boot object _bootObject = GetBootObject(bootParameter); // Assert condition to check for jobscheduled by _bootObject.JobScheduleCreatedBy.ShouldNotBeEmpty(); _bootObject.BinderFolderId.ShouldNotBe(0); // Get Dataset Details to know about the Collection id and the Matter ID details _datasetEntity = DataSetBO.GetDataSetDetailForDataSetId(_bootObject.datasetId); //Assert condition to check for dataset details _datasetEntity.ShouldNotBe(null); _binderEntity = BinderBO.GetBinderDetails(_bootObject.BinderFolderId.ToString()); _binderEntity.ShouldNotBe(null); _reviewSetRecord = ConvertToReviewSetRecord(_bootObject); // Construct the document query entity to determine the total documents _docQueryEntity = GetQueryEntity(_bootObject, _datasetEntity, 0, 1, null); // Mock the user session MockSession(); _docQueryEntity.TransactionName = _docQueryEntity.QueryObject.TransactionName = "ReviewsetStartupWorker - DoBeginWork (GetCount)"; var reviewsetLogic = _reviewSetRecord.ReviewSetLogic.ToLower(); if (reviewsetLogic == "all" || reviewsetLogic == "tag") { var searchQuery = !string.IsNullOrEmpty(_bootObject.SearchQuery)? _bootObject.SearchQuery.Replace("\"", ""): string.Empty; _totalDocumentCount = DocumentBO.GetDocumentCountForCreateReviewsetJob(_datasetEntity.Matter.FolderID, _datasetEntity.CollectionId, reviewsetLogic, searchQuery); } else { // Retrieve the total documents qualified _totalDocumentCount = ReviewerSearchInstance.GetDocumentCount(_docQueryEntity.QueryObject); } Tracer.Info("Reviewset Startup Worker : {0} matching documents determined for the requested query", _totalDocumentCount); if (_totalDocumentCount < 1) { var message = String.Format("Search server does not return any documents for the reviewset '{0}'", _reviewSetRecord.ReviewSetName); throw new ApplicationException(message); } LogMessage(true, string.Format("{0} documents are qualified", _totalDocumentCount)); // Construct the document query entity to write the resultant documents in xml file var outputFields = new List <Field>(); outputFields.AddRange(new List <Field>() { new Field { FieldName = EVSystemFields.DcnField }, new Field { FieldName = EVSystemFields.FamilyId }, new Field { FieldName = EVSystemFields.DuplicateId } }); _docQueryEntity = GetQueryEntity(_bootObject, _datasetEntity, 0, Convert.ToInt32(_totalDocumentCount), outputFields); }