Ejemplo n.º 1
0
        /// <summary>
        /// Updates the reviewset status to Active in DB
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <param name="status"></param>
        /// <param name="isAuditable"></param>
        private void UpdateReviewSetStatus(ReviewsetRecord reviewsetRecord, int status, bool isAuditable = true)
        {
            ReviewsetDetailsBEO reviewsetEntity = ConvertToReviewsetBusinessEntity(reviewsetRecord, status);

            reviewsetEntity.IsAuditable = isAuditable;
            using (EVTransactionScope transScope = new EVTransactionScope(TransactionScopeOption.Suppress))
            {
                //if all the documents are added successfully then update the status of review set
                ReviewSetBO.UpdateReviewSet(reviewsetEntity, false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the reviewset status to Active in DB
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        private void UpdateReviewSetStatus(ReviewsetRecord reviewsetRecord)
        {
            var reviewsetEntity = ConvertToReviewsetBusinessEntity(reviewsetRecord);

            reviewsetEntity.IsAuditable = false;
            using (var transScope = new EVTransactionScope(TransactionScopeOption.Suppress))
            {
                //if all the documents are added successfully then update the status of review set
                ReviewSetBO.UpdateReviewSet(reviewsetEntity, false);
            }
        }
        /// <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.CreatedByGUID.ShouldNotBeEmpty();

            // Get Dataset Details to know about the Collection id and the Matter ID details
            _datasetEntity = DataSetBO.GetDataSetDetailForDataSetId(_bootObject.datasetId);
            _bootObject.BinderFolderId.ShouldNotBe(0);

            _binderEntity = BinderBO.GetBinderDetails(_bootObject.BinderFolderId.ToString());
            _binderEntity.ShouldNotBe(null);

            //Assert condition to check for dataset details
            _datasetEntity.ShouldNotBe(null);
            _datasetEntity.Matter.ShouldNotBe(null);

            _reviewSetRecord = ConvertToReviewSetRecord(_bootObject, _datasetEntity);


            // Construct the document query entity to determine the total documents
            _docQueryEntity = GetQueryEntity(_bootObject, _datasetEntity, 0, 1, null);
            _docQueryEntity.TransactionName = _docQueryEntity.QueryObject.TransactionName =
                "ReviewsetStartupWorker - DoBeginWork (GetCount)";

            // Mock the user session
            MockSession();


            var reviewSetDetails = ReviewSetBO.GetReviewSetDetails(_datasetEntity.Matter.FolderID.ToString(),
                                                                   _bootObject.ReviewSetId);

            if (reviewSetDetails != null)
            {
                reviewSetDetails.Action     = _reviewSetRecord.Activity;
                reviewSetDetails.BinderName = _binderEntity.BinderName;
                //Audit Logging for existing review set
                ReviewSetBO.UpdateReviewSet(reviewSetDetails, false, false);
            }
            // Retrieve the total documents qualified
            _totalDocumentCount = ReviewerSearchInstance.GetDocumentCount(_docQueryEntity.QueryObject);


            Tracer.Info("Split Reviewset Startup Worker : {0} matching documents determined for the requested query",
                        _totalDocumentCount);
            if (_totalDocumentCount < 1)
            {
                var message = String.Format("Search engine does not return any documents for Reviewset {0}",
                                            _reviewSetRecord.ReviewSetName);
                throw new ApplicationException(message);
            }

            // 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.FamilyId
                },
                new Field {
                    FieldName = EVSystemFields.DocumentKey
                },
                new Field {
                    FieldName = EVSystemFields.ReviewSetId
                },
                new Field {
                    FieldName = EVSystemFields.DuplicateId
                },
                new Field {
                    FieldName = EVSystemFields.Tag.ToLower()
                },
                new Field {
                    FieldName = _datasetEntity.DocumentControlNumberName
                }
            });
            _docQueryEntity = GetQueryEntity(_bootObject, _datasetEntity, 0, Convert.ToInt32(_totalDocumentCount),
                                             outputFields);
        }