Ejemplo n.º 1
0
        /// <summary>
        /// Converts Merge Review Set Job BEO to Create Review Set Task BEO
        /// </summary>
        /// <param name="reviewSetBeo"></param>
        /// <returns></returns>
        private static CreateReviewSetTaskBEO ConvertToCTaskBeo(MergeReviewSetTaskBEO reviewSetBeo)
        {
            CreateReviewSetTaskBEO reviewSet = new CreateReviewSetTaskBEO
            {
                ReviewSetId             = reviewSetBeo.ReviewSetId,
                ReviewSetName           = reviewSetBeo.ReviewSetName,
                DatasetId               = reviewSetBeo.DatasetId,
                NumberOfDocumentsPerSet = reviewSetBeo.NumberOfDocumentsPerSet,
                NumberOfReviewSets      = reviewSetBeo.NumberOfReviewSets,
                StatusId             = reviewSetBeo.StatusId,
                ReviewsetDescription = reviewSetBeo.ReviewsetDescription,
                StartDate            = reviewSetBeo.StartDate,
                DueDate         = reviewSetBeo.DueDate,
                ReviewSetLogic  = reviewSetBeo.ReviewSetLogic,
                SplittingOption = reviewSetBeo.SplittingOption,
                SearchQuery     = reviewSetBeo.SearchQuery,
                KeepDuplicates  = reviewSetBeo.KeepDuplicates,
                KeepFamily      = reviewSetBeo.KeepFamily,
                ReviewSetGroup  = reviewSetBeo.ReviewSetGroup
            };



            reviewSet.Documents.AddRange(reviewSetBeo.Documents);
            reviewSet.ReviewSetUserList.AddRange(reviewSetBeo.ReviewSetUserList);

            return(reviewSet);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// converts review set record to reviewset business entity to save to reviewset master details in vault DB
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <returns></returns>
        private CreateReviewSetTaskBEO ConverttoReviewsetBusinessEntity(ReviewsetRecord reviewsetRecord)
        {
            var reviewSetBusinesssEntity = new CreateReviewSetTaskBEO();

            reviewSetBusinesssEntity.ReviewSetName        = reviewsetRecord.ReviewSetName;
            reviewSetBusinesssEntity.ReviewsetDescription = reviewsetRecord.ReviewSetDescription;
            reviewSetBusinesssEntity.DatasetId            = reviewsetRecord.DatasetId;
            reviewSetBusinesssEntity.ReviewSetId          = reviewsetRecord.ReviewSetId;
            reviewSetBusinesssEntity.BinderId             = reviewsetRecord.BinderId;
            reviewSetBusinesssEntity.BinderName           = reviewsetRecord.BinderName;
            reviewSetBusinesssEntity.DueDate              = reviewsetRecord.DueDate;
            reviewSetBusinesssEntity.KeepDuplicates       = reviewsetRecord.KeepDuplicatesTogether;
            reviewSetBusinesssEntity.KeepFamily           = reviewsetRecord.KeepFamilyTogether;
            reviewSetBusinesssEntity.ReviewSetGroup       = reviewsetRecord.ReviewSetGroup;
            reviewSetBusinesssEntity.ReviewSetLogic       = reviewsetRecord.ReviewSetLogic;
            reviewSetBusinesssEntity.SearchQuery          = reviewsetRecord.SearchQuery;
            reviewSetBusinesssEntity.SplittingOption      = reviewsetRecord.SplittingOption;
            reviewSetBusinesssEntity.StartDate            = reviewsetRecord.StartDate;
            reviewSetBusinesssEntity.NumberOfDocuments    = reviewsetRecord.NumberOfDocuments;
            reviewSetBusinesssEntity.NumberOfReviewedDocs = reviewsetRecord.NumberOfReviewedDocs;
            reviewSetBusinesssEntity.ReviewSetUserList.AddRange(reviewsetRecord.ReviewSetUserList);
            if (PipelineType == null ||
                PipelineType.Moniker == null ||
                String.IsNullOrEmpty(PipelineType.Moniker))
            {
                return(reviewSetBusinesssEntity);
            }

            if (PipelineType.Moniker.Equals(Constants.SplitReviewsetPipeLineType))
            {
                reviewSetBusinesssEntity.Action = Constants.Spilt;
            }
            return(reviewSetBusinesssEntity);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// creates reviewset with given details
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <returns></returns>
        private string CreateReviewset(DocumentRecordCollection reviewsetRecord)
        {
            reviewsetRecord.ShouldNotBe(null);
            string reviewsetName = reviewsetRecord.ReviewsetDetails.ReviewSetName;

            if (m_AllReviewSetinBinder.Exists(o => o.ReviewSetName.ToLower() == reviewsetName.ToLower()))
            {
                throw new Exception(string.Format("{0}{1}{2}", Constants.ReviewsetNameLog, reviewsetRecord.ReviewsetDetails.ReviewSetName, Constants.AlreadyExistsLog));
            }

            //create the review set with the details sent
            using (EVTransactionScope transScope = new EVTransactionScope(TransactionScopeOption.Suppress))
            {
                CreateReviewSetTaskBEO reviewSetBusinesssEntity = ConverttoReviewsetBusinessEntity(reviewsetRecord.ReviewsetDetails);
                //Creates the reviewset
                string reviewsetId = ReviewSetBO.CreateReviewSetJob(reviewSetBusinesssEntity);

                return(reviewsetId);
            };
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Atomic work 1) Delete search sub-system Data 2) Delete Vault Data 3) Delete EVMaster Data
        /// </summary>
        /// <param name="task"></param>
        /// <param name="jobParameters"></param>
        /// <returns></returns>
        protected override bool DoAtomicWork(MergeReviewSetTaskBEO task, MergeReviewSetJobBEO jobParameters)
        {
            bool output = false;

            try
            {
                string datasetId = task.DatasetId.ToString(CultureInfo.InvariantCulture);

                switch (task.Activity)
                {
                case Constants.Create:
                {
                    /*since documents not needed for create reviewset, removing the docouments from the ReviewsetTaskBeo*/
                    List <RVWDocumentBEO> taskDocs = new List <RVWDocumentBEO>();
                    task.Documents.SafeForEach(taskDocs.Add);
                    task.Documents.Clear();

                    CreateReviewSetTaskBEO createReviewSetTaskBeo = ConvertToCTaskBeo(task);
                    createReviewSetTaskBeo.StatusId        = 1;
                    createReviewSetTaskBeo.Activity        = Constants.Merge;
                    createReviewSetTaskBeo.SplittingOption = Constants.Single;

                    /*Create Reviewset*/
                    task.reviewSetId = ReviewSetService.CreateReviewSetJob(createReviewSetTaskBeo);
                    taskDocs.SafeForEach(o => task.Documents.Add(o));

                    UpdateReviewSetTaskBEO updateReviewSetTaskBeo = ConvertToUTaskBeo(task);
                    updateReviewSetTaskBeo.StatusId        = 1;
                    updateReviewSetTaskBeo.Activity        = Constants.Merge;
                    updateReviewSetTaskBeo.SplittingOption = Constants.Single;
                    ReviewSetService.UpdateReviewSetJob(updateReviewSetTaskBeo);

                    //Assigning the reviewset id to the documents
                    IEnumerable <ReviewsetDocumentBEO> rsDocBeoList = PopulateReviewSetDocumentEntites(task.ReviewSetId, task.Documents);
                    output = AddDocumentsBychunk(datasetId, task.reviewSetId, rsDocBeoList);
                    output = true;
                    break;
                }

                default:
                {
                    if (task.Documents.Count > 0)
                    {
                        //Assigning the reviewset id to the documents
                        IEnumerable <ReviewsetDocumentBEO> rsDocBeoList = PopulateReviewSetDocumentEntites(task.ReviewSetId, task.Documents);

                        //Delete documents from vault and  from search sub-system
                        output = RemoveDocumentsBychunk(datasetId, task.reviewSetId, rsDocBeoList);
                    }
                    //Update Review set service - Archiving
                    UpdateReviewSetTaskBEO updateReviewSetTaskBeo = ConvertToUTaskBeo(task);
                    ReviewSetService.UpdateReviewSetJob(updateReviewSetTaskBeo);
                    output = true;
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                ex.AddResMsg(ErrorCodes.ProblemInDoAtomicWork).Trace().Swallow();
            }
            return(output);
        }
        /// <summary>
        /// converts review set record to reviewset business entity to save to reviewset master details in vault DB
        /// </summary>
        /// <param name="reviewsetRecord"></param>
        /// <returns></returns>
        private CreateReviewSetTaskBEO ConverttoReviewsetBusinessEntity(ReviewsetRecord reviewsetRecord)
        {
            var reviewSetBusinesssEntity = new CreateReviewSetTaskBEO();

            reviewSetBusinesssEntity.ReviewSetName = reviewsetRecord.ReviewSetName;
            reviewSetBusinesssEntity.ReviewsetDescription = reviewsetRecord.ReviewSetDescription;
            reviewSetBusinesssEntity.DatasetId = reviewsetRecord.DatasetId;
            reviewSetBusinesssEntity.ReviewSetId = reviewsetRecord.ReviewSetId;
            reviewSetBusinesssEntity.BinderId = reviewsetRecord.BinderId;
            reviewSetBusinesssEntity.BinderName = reviewsetRecord.BinderName;
            reviewSetBusinesssEntity.DueDate = reviewsetRecord.DueDate;
            reviewSetBusinesssEntity.KeepDuplicates = reviewsetRecord.KeepDuplicatesTogether;
            reviewSetBusinesssEntity.KeepFamily = reviewsetRecord.KeepFamilyTogether;
            reviewSetBusinesssEntity.ReviewSetGroup = reviewsetRecord.ReviewSetGroup;
            reviewSetBusinesssEntity.ReviewSetLogic = reviewsetRecord.ReviewSetLogic;
            reviewSetBusinesssEntity.SearchQuery = reviewsetRecord.SearchQuery;
            reviewSetBusinesssEntity.SplittingOption = reviewsetRecord.SplittingOption;
            reviewSetBusinesssEntity.StartDate = reviewsetRecord.StartDate;
            reviewSetBusinesssEntity.NumberOfDocuments = reviewsetRecord.NumberOfDocuments;
            reviewSetBusinesssEntity.NumberOfReviewedDocs = reviewsetRecord.NumberOfReviewedDocs;
            reviewSetBusinesssEntity.ReviewSetUserList.AddRange(reviewsetRecord.ReviewSetUserList);
            if (PipelineType==null
                ||PipelineType.Moniker==null
                ||String.IsNullOrEmpty(PipelineType.Moniker))
                
            return reviewSetBusinesssEntity;

            if (PipelineType.Moniker.Equals(Constants.SplitReviewsetPipeLineType))
                reviewSetBusinesssEntity.Action = Constants.Spilt;
            return reviewSetBusinesssEntity;
        }