/// <summary>
        /// Send Worker response to Pipe.
        /// </summary>
        /// <param name="recordList"></param>
        private void Send(List <LoadFileRecord> recordList)
        {
            // In case of append, assign the dcn for the documents here
            if (m_Parameters.IsAppend)
            {
                // Assign DCN
                AssignDocumentControlNumber(recordList);
            }

            var recordCollection = new LoadFileRecordCollection
            {
                Records            = recordList,
                dataset            = m_Dataset,
                UniqueThreadString = _uniqueThreadString
            };

            OutputDataPipe.ShouldNotBe(null);
            var message = new PipeMessageEnvelope
            {
                Body = recordCollection
            };

            OutputDataPipe.Send(message);
            IncreaseProcessedDocumentsCount(recordList.Count);
        }
        /// <summary>
        /// Send Worker response to Pipe.
        /// </summary>
        private void SendDataPipe()
        {
            OutputDataPipe.ShouldNotBe(null);
            var message = new PipeMessageEnvelope {
                Body = true
            };

            OutputDataPipe.Send(message);
            IncreaseProcessedDocumentsCount(_documentCount);
        }
        /// <summary>
        /// Send Worker response to Pipe.
        /// </summary>
        private void SendDataPipe(List <Data.NearDuplicationResultInfo> data)
        {
            OutputDataPipe.ShouldNotBe(null);
            var message = new PipeMessageEnvelope
            {
                Body = new Data.NearDuplicationResultInfoCollection {
                    ResultDocuments = data
                }
            };

            OutputDataPipe.Send(message);
        }
        /// <summary>
        /// Send Worker response to Pipe.
        /// </summary>
        /// <param name="documents"></param>
        private void Send(List <RVWDocumentBEO> documents)
        {
            OutputDataPipe.ShouldNotBe(null);
            var documentList = new LawDocumentCollection {
                Documents = documents, Dataset = _datasetDetails
            };
            var message = new PipeMessageEnvelope
            {
                Body = documentList
            };

            OutputDataPipe.Send(message);
            IncreaseProcessedDocumentsCount(documents.Count);
        }
예제 #5
0
        /// <summary>
        /// Send data to Data pipe
        /// </summary>
        /// <param name="docDetails"></param>
        private void Send(List <DocumentDetail> docDetails)
        {
            OutputDataPipe.ShouldNotBe(null);
            var documentList = new DocumentCollection()
            {
                documents = docDetails, dataset = _dataset
            };
            var message = new PipeMessageEnvelope()
            {
                Body = documentList
            };

            OutputDataPipe.Send(message);
            IncreaseProcessedDocumentsCount(docDetails.Count);
        }
        /// <summary>
        /// To generate message and pass to the next worker with collection of documents in a batch
        /// </summary>
        /// <returns></returns>
        protected override bool GenerateMessage()
        {
            try
            {
                OutputDataPipe.ShouldNotBe(null);
                if (_jobParams == null)
                {
                    _jobParams = GetJobParams(BootParameters);
                }
                var documents =
                    LawBO.GetDocuments(_jobParams.LawCaseId, _selectedFields, _selectedTags, _jobParams.TagFilters);

                if (documents != null)
                {
                    var localDocumentList = new List <RVWDocumentBEO>();
                    foreach (var doc in documents)
                    {
                        doc.DocumentId = GetDocumentId();
                        //Setting the Cross Reference field with LAW DocID by default
                        doc.CrossReferenceFieldValue = doc.LawDocumentId.ToString(CultureInfo.InvariantCulture);
                        localDocumentList.Add(doc);
                        if (localDocumentList.Count % _batchSize != 0)
                        {
                            continue;
                        }
                        ProcessMessage(localDocumentList);
                        localDocumentList.Clear();
                    }

                    //Sending remaining documents for process
                    if (localDocumentList.Any())
                    {
                        ProcessMessage(localDocumentList);
                    }
                }
            }
            catch (Exception ex)
            {
                LogMessage(false, ex.ToUserString());
                ReportToDirector(ex.ToUserString());
                throw;
            }

            LogMessage(true, Constants.ParserSuccessMessage);
            return(true);
        }