internal override void SetPipelineTypeSpecificParameters(ActiveJob activeJob)
        {
            LawSyncBEO jobParameter = null;

            base.SetPipelineTypeSpecificParameters(activeJob);
            switch (JobTypeId)
            {
            case 40:
                jobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(activeJob.BootParameters.ToString(), typeof(LawSyncBEO));
                break;

            case 41:
            {
                var reprocessJobParameter = (ConversionReprocessJobBeo)XmlUtility.DeserializeObject(activeJob.BootParameters.ToString(), typeof(ConversionReprocessJobBeo));

                var baseConfig = ReconversionDAO.GetJobConfigInfo(Convert.ToInt32(reprocessJobParameter.OrginialJobId));
                jobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(baseConfig.BootParameters, typeof(LawSyncBEO));
            }
            break;
            }
            if (jobParameter == null)
            {
                return;
            }
            MatterId  = jobParameter.MatterId;
            SyncImage = jobParameter.IsProduceImage;
            LawCaseId = jobParameter.LawCaseId;
        }
Example #2
0
        protected override void BeginWork()
        {
            base.BeginWork();

            _reprocessJobParameter = (ConversionReprocessJobBeo)XmlUtility.DeserializeObject(BootParameters, typeof(ConversionReprocessJobBeo));

            var baseConfig = ReconversionDAO.GetJobConfigInfo(Convert.ToInt32(_reprocessJobParameter.OrginialJobId));

            _lawSyncJobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(baseConfig.BootParameters, typeof(LawSyncBEO));

            _dataset = DataSetBO.GetDataSetDetailForDataSetId(_lawSyncJobParameter.DatasetId);
            var field = _dataset.DatasetFieldList.FirstOrDefault(f => f.FieldType.DataTypeId == Constants.DCNFieldTypeId);

            if (field != null)
            {
                _dcnFieldName = field.Name;
            }

            var lawField = _dataset.DatasetFieldList.FirstOrDefault(f => f.Name == EVSystemFields.LawDocumentId);

            if (lawField != null)
            {
                _lawFieldId = lawField.ID;
            }

            if (_lawSyncJobParameter.IsProduceImage)
            {
                _jobEVImagesDirectory = LawVolumeHelper.GetJobImageFolder(WorkAssignment.JobId,
                                                                          _lawSyncJobParameter.LawCaseId);
                _volumeCount++;
                _volumeFolderName = LawVolumeHelper.CreateVolumeFolder(_jobEVImagesDirectory, _volumeCount);
            }

            _vaultManager = EVUnityContainer.Resolve <IDocumentVaultManager>(Constants.DocumentVaultManager);
        }
        protected override void BeginWork()
        {
            base.BeginWork();

            _reprocessJobParameter =(ConversionReprocessJobBeo)XmlUtility.DeserializeObject(BootParameters, typeof (ConversionReprocessJobBeo));

            var baseConfig = ReconversionDAO.GetJobConfigInfo(Convert.ToInt32(_reprocessJobParameter.OrginialJobId));

            _lawSyncJobParameter =(LawSyncBEO) XmlUtility.DeserializeObject(baseConfig.BootParameters, typeof (LawSyncBEO));

            _dataset = DataSetBO.GetDataSetDetailForDataSetId(_lawSyncJobParameter.DatasetId);
            var field =_dataset.DatasetFieldList.FirstOrDefault(f => f.FieldType.DataTypeId == Constants.DCNFieldTypeId);
            if (field != null) _dcnFieldName = field.Name;
            
            var lawField=_dataset.DatasetFieldList.FirstOrDefault(f => f.Name == EVSystemFields.LawDocumentId);
            if (lawField != null) _lawFieldId = lawField.ID;

            if (_lawSyncJobParameter.IsProduceImage)
            {
                _jobEVImagesDirectory = LawVolumeHelper.GetJobImageFolder(WorkAssignment.JobId,
                    _lawSyncJobParameter.LawCaseId);
                _volumeCount++;
                _volumeFolderName = LawVolumeHelper.CreateVolumeFolder(_jobEVImagesDirectory, _volumeCount);
            }

            _vaultManager = EVUnityContainer.Resolve<IDocumentVaultManager>(Constants.DocumentVaultManager);
        }
Example #4
0
        protected override void ProcessMessage(PipeMessageEnvelope message)
        {
            try
            {
                if (message.Body == null)
                {
                    return;
                }

                var lawDocumentsList = (LawSyncDocumentCollection)message.Body;

                if (_jobParameter == null)
                {
                    if (lawDocumentsList.IsLawSyncReprocessJob)
                    {
                        _jobParameter = lawDocumentsList.OrginalJobParameter;
                    }
                    else
                    {
                        _jobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(BootParameters, typeof(LawSyncBEO));
                    }
                }

                _redactableSetCollectionId = lawDocumentsList.RedactableSetCollectionId;
                _datasetExtractionPath     = lawDocumentsList.DatasetExtractionPath;
                _datasetCollectionId       = lawDocumentsList.DatasetCollectionId;
                _lawSyncJobId             = lawDocumentsList.LawSynJobId;
                _logInfoList              = new List <JobWorkerLog <LawSyncLogInfo> >();
                _documentProcessStateList = new List <DocumentConversionLogBeo>();
                var lawImagingDocuments = lawDocumentsList.Documents.Where(d => d.IsImaging).ToList();

                if (_jobParameter.IsProduceImage && lawImagingDocuments.Any())
                {
                    var documentIds = lawImagingDocuments.Select(d => d.DocumentReferenceId).ToList();
                    _documentsBinaryList = GetNearNativeFileForDocuments(_jobParameter.MatterId,
                                                                         _redactableSetCollectionId,
                                                                         documentIds);
                    foreach (var document in lawImagingDocuments)
                    {
                        SendDocumentForImaging(document);
                    }
                }
                if (_documentProcessStateList.Any())
                {
                    UpdateDcoumentProcessState(_documentProcessStateList);
                }
                Send(lawDocumentsList);
                if (_logInfoList != null && _logInfoList.Any())
                {
                    SendLogPipe(_logInfoList);
                }
            }
            catch (Exception ex)
            {
                ReportToDirector(ex);
                ex.Trace().Swallow();
                LogMessage(Constants.LawSyncFailureinImagingMessage + ex.ToUserString());
            }
        }
        protected override void ProcessMessage(PipeMessageEnvelope message)
        {
            try
            {
                if (message.Body == null)
                {
                    return;
                }

                var lawDocumentsList = (LawSyncDocumentCollection) message.Body;

                if (_jobParameter == null)
                {
                    if (lawDocumentsList.IsLawSyncReprocessJob)
                    {
                        _jobParameter = lawDocumentsList.OrginalJobParameter;
                    }
                    else
                    {
                        _jobParameter = (LawSyncBEO) XmlUtility.DeserializeObject(BootParameters, typeof (LawSyncBEO));
                    }
                }

                _redactableSetCollectionId = lawDocumentsList.RedactableSetCollectionId;
                _datasetExtractionPath = lawDocumentsList.DatasetExtractionPath;
                _datasetCollectionId = lawDocumentsList.DatasetCollectionId;
                _lawSyncJobId = lawDocumentsList.LawSynJobId;
                _logInfoList = new List<JobWorkerLog<LawSyncLogInfo>>();
                _documentProcessStateList = new List<DocumentConversionLogBeo>();
                var lawImagingDocuments = lawDocumentsList.Documents.Where(d => d.IsImaging).ToList();

                if (_jobParameter.IsProduceImage && lawImagingDocuments.Any())
                {
                    var documentIds = lawImagingDocuments.Select(d => d.DocumentReferenceId).ToList();
                    _documentsBinaryList = GetNearNativeFileForDocuments(_jobParameter.MatterId,
                        _redactableSetCollectionId,
                        documentIds);
                    foreach (var document in lawImagingDocuments)
                    {
                        SendDocumentForImaging(document);
                    }
                }
                if (_documentProcessStateList.Any())
                {
                    UpdateDcoumentProcessState(_documentProcessStateList);
                }
                Send(lawDocumentsList);
                if (_logInfoList != null && _logInfoList.Any())
                {
                    SendLogPipe(_logInfoList);
                }
            }
            catch (Exception ex)
            {
                ReportToDirector(ex);
                ex.Trace().Swallow();
                LogMessage(Constants.LawSyncFailureinImagingMessage + ex.ToUserString());
            }
        }
        protected override void ProcessMessage(PipeMessageEnvelope message)
        {
            try
            {
                if (message.Body == null)
                {
                    return;
                }
                var lawDocumentsList = (LawSyncDocumentCollection) message.Body;
                if (_jobParameter == null)
                {
                    if (lawDocumentsList.IsLawSyncReprocessJob)
                    {
                        _jobParameter = lawDocumentsList.OrginalJobParameter;
                    }
                    else
                    {
                        _jobParameter = (LawSyncBEO) XmlUtility.DeserializeObject(BootParameters, typeof (LawSyncBEO));
                    }
                }
                _datasetCollectionId = lawDocumentsList.DatasetCollectionId;
                _lawSyncJobId = lawDocumentsList.LawSynJobId;
                _logInfoList = new List<JobWorkerLog<LawSyncLogInfo>>();
                _documentProcessStateList = new List<DocumentConversionLogBeo>();
                _dataset = DataSetBO.GetDataSetDetailForDataSetId(_jobParameter.DatasetId);
                if (lawDocumentsList.Documents.Any())
                {
                    foreach (var lawDocument in lawDocumentsList.Documents)
                    {
                        SetMetadataForDcoument(lawDocument);
                    }

                }

                if (_documentProcessStateList.Any())
                {
                    UpdateDcoumentProcessState(_documentProcessStateList);
                }

                Send(lawDocumentsList);
                if (_logInfoList.Any())
                {
                    SendLogPipe(_logInfoList);
                }
            }
            catch (Exception ex)
            {
                ReportToDirector(ex);
                ex.Trace().Swallow();
                LogMessage(Constants.LawSyncFailureinGetMetadataMessage + ex.ToUserString());
            }
        }
        protected override void ProcessMessage(PipeMessageEnvelope message)
        {
            try
            {
                if (message.Body == null)
                {
                    return;
                }
                var lawDocumentsList = (LawSyncDocumentCollection)message.Body;
                if (_jobParameter == null)
                {
                    if (lawDocumentsList.IsLawSyncReprocessJob)
                    {
                        _jobParameter = lawDocumentsList.OrginalJobParameter;
                    }
                    else
                    {
                        _jobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(BootParameters, typeof(LawSyncBEO));
                    }
                }
                _datasetCollectionId      = lawDocumentsList.DatasetCollectionId;
                _lawSyncJobId             = lawDocumentsList.LawSynJobId;
                _logInfoList              = new List <JobWorkerLog <LawSyncLogInfo> >();
                _documentProcessStateList = new List <DocumentConversionLogBeo>();

                _lawEvAdapter          = LawBO.GetLawAdapter(_jobParameter.LawCaseId);
                _imageArchiveDirectory = _lawEvAdapter.GetImageArchiveDirectory();

                var lawImagingDocuments = lawDocumentsList.Documents.Where(d => d.IsImaging).ToList();
                if (_jobParameter.IsProduceImage && lawImagingDocuments.Any())
                {
                    _logInfoList = new List <JobWorkerLog <LawSyncLogInfo> >();
                    ProcessDocumentImages(lawDocumentsList);
                }

                if (_logInfoList.Any())
                {
                    SendLogPipe(_logInfoList);
                }
                if (_documentProcessStateList.Any())
                {
                    UpdateDcoumentProcessState(_documentProcessStateList);
                }
            }
            catch (Exception ex)
            {
                ReportToDirector(ex);
                ex.Trace().Swallow();
                LogMessage(Constants.LawSyncFailureinSyncImageMessage + ex.ToUserString());
            }
        }
        protected override void ProcessMessage(PipeMessageEnvelope message)
        {
            try
            {
                if (message.Body == null)
                {
                    return;
                }
                var lawDocumentsList = (LawSyncDocumentCollection)message.Body;
                if (_jobParameter == null)
                {
                    if (lawDocumentsList.IsLawSyncReprocessJob)
                    {
                        _jobParameter = lawDocumentsList.OrginalJobParameter;
                    }
                    else
                    {
                        _jobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(BootParameters, typeof(LawSyncBEO));
                    }
                }
                _datasetCollectionId      = lawDocumentsList.DatasetCollectionId;
                _lawSyncJobId             = lawDocumentsList.LawSynJobId;
                _logInfoList              = new List <JobWorkerLog <LawSyncLogInfo> >();
                _documentProcessStateList = new List <DocumentConversionLogBeo>();
                _dataset = DataSetBO.GetDataSetDetailForDataSetId(_jobParameter.DatasetId);
                if (lawDocumentsList.Documents.Any())
                {
                    foreach (var lawDocument in lawDocumentsList.Documents)
                    {
                        SetMetadataForDcoument(lawDocument);
                    }
                }

                if (_documentProcessStateList.Any())
                {
                    UpdateDcoumentProcessState(_documentProcessStateList);
                }

                Send(lawDocumentsList);
                if (_logInfoList.Any())
                {
                    SendLogPipe(_logInfoList);
                }
            }
            catch (Exception ex)
            {
                ReportToDirector(ex);
                ex.Trace().Swallow();
                LogMessage(Constants.LawSyncFailureinGetMetadataMessage + ex.ToUserString());
            }
        }
        protected override void ProcessMessage(PipeMessageEnvelope message)
        {
            try
            {
                if (message.Body == null)
                {
                    return;
                }
                var lawDocumentsList = (LawSyncDocumentCollection) message.Body;
                if (_jobParameter == null)
                {
                    if (lawDocumentsList.IsLawSyncReprocessJob)
                        _jobParameter = lawDocumentsList.OrginalJobParameter;
                    else
                        _jobParameter = (LawSyncBEO) XmlUtility.DeserializeObject(BootParameters, typeof (LawSyncBEO));
                }
                _datasetCollectionId = lawDocumentsList.DatasetCollectionId;
                _lawSyncJobId = lawDocumentsList.LawSynJobId;
                _logInfoList = new List<JobWorkerLog<LawSyncLogInfo>>();
                _documentProcessStateList = new List<DocumentConversionLogBeo>();

                _lawEvAdapter = LawBO.GetLawAdapter(_jobParameter.LawCaseId);
                _imageArchiveDirectory = _lawEvAdapter.GetImageArchiveDirectory();

                var lawImagingDocuments = lawDocumentsList.Documents.Where(d => d.IsImaging).ToList();
                if (_jobParameter.IsProduceImage && lawImagingDocuments.Any())
                {
                    _logInfoList = new List<JobWorkerLog<LawSyncLogInfo>>();
                    ProcessDocumentImages(lawDocumentsList);
                }

                if (_logInfoList.Any())
                {
                    SendLogPipe(_logInfoList);
                }
                if (_documentProcessStateList.Any())
                {
                    UpdateDcoumentProcessState(_documentProcessStateList);
                }
            }
            catch (Exception ex)
            {
                ReportToDirector(ex);
                ex.Trace().Swallow();
                LogMessage(Constants.LawSyncFailureinSyncImageMessage + ex.ToUserString());
            }
        }
        protected override void BeginWork()
        {
            base.BeginWork();
            _jobParameter = (LawSyncBEO)XmlUtility.DeserializeObject(BootParameters, typeof(LawSyncBEO));

            #region "Assertion"
            _jobParameter.DatasetId.ShouldBeGreaterThan(0);
            _jobParameter.MatterId.ShouldBeGreaterThan(0);
            #endregion
            try
            {
                //Get DCN field name
                _dataset = GetDatasetDetails(_jobParameter.DatasetId, _jobParameter.MatterId);
                var field =
                    _dataset.DatasetFieldList.FirstOrDefault(f => f.FieldType.DataTypeId == Constants.DCNFieldTypeId);
                if (field != null)
                {
                    _dcnFieldName = field.Name;
                }

                var lawField = _dataset.DatasetFieldList.FirstOrDefault(f => f.Name == EVSystemFields.LawDocumentId);
                if (lawField != null)
                {
                    _lawFieldId = lawField.ID;
                }

                //Create Volume for Images
                if (_jobParameter.IsProduceImage)
                {
                    _jobEVImagesDirectory = LawVolumeHelper.GetJobImageFolder(WorkAssignment.JobId,
                                                                              _jobParameter.LawCaseId);
                    _volumeCount++;
                    _volumeFolderName = LawVolumeHelper.CreateVolumeFolder(_jobEVImagesDirectory, _volumeCount);
                }
                _vaultManager = EVUnityContainer.Resolve <IDocumentVaultManager>(Constants.DocumentVaultManager);
            }
            catch (Exception ex)
            {
                ex.Trace();
                ReportToDirector(ex);
                ConstructLog(Constants.LawSyncStartupFailureMessage);
                throw;
            }
        }
        protected override void BeginWork()
        {
            base.BeginWork();
            _jobParameter = (LawSyncBEO) XmlUtility.DeserializeObject(BootParameters, typeof (LawSyncBEO));

            #region "Assertion"
            _jobParameter.DatasetId.ShouldBeGreaterThan(0);
            _jobParameter.MatterId.ShouldBeGreaterThan(0);
            #endregion
            try
            {
                //Get DCN field name
                _dataset = GetDatasetDetails(_jobParameter.DatasetId, _jobParameter.MatterId);
                var field =
                    _dataset.DatasetFieldList.FirstOrDefault(f => f.FieldType.DataTypeId == Constants.DCNFieldTypeId);
                if (field != null) _dcnFieldName = field.Name;

                var lawField = _dataset.DatasetFieldList.FirstOrDefault(f => f.Name == EVSystemFields.LawDocumentId);
                if (lawField != null) _lawFieldId = lawField.ID;

                //Create Volume for Images
                if (_jobParameter.IsProduceImage)
                {
                    _jobEVImagesDirectory = LawVolumeHelper.GetJobImageFolder(WorkAssignment.JobId,
                        _jobParameter.LawCaseId);
                    _volumeCount++;
                    _volumeFolderName = LawVolumeHelper.CreateVolumeFolder(_jobEVImagesDirectory, _volumeCount);
                }
                _vaultManager = EVUnityContainer.Resolve<IDocumentVaultManager>(Constants.DocumentVaultManager);
            }
            catch (Exception ex)
            {
                ex.Trace();
                ReportToDirector(ex);
                ConstructLog(Constants.LawSyncStartupFailureMessage);
                throw;
            }
        }