public void Handle(GeneralProjectChangedLocalMessage message)
 {
     Data.ProjectId = message.ProjectId;
     Data.GeneralId = message.GeneralId;
     if (message.GeneralId > 0)
     {
         _commentsIndexing.Start();
     }
     else
     {
         MarkAsComplete();
     }
 }
Esempio n. 2
0
 public IndexExistingEntitiesSaga(IEntityIndexer entityIndexer, IEntityTypeProvider entityTypesProvider, IDocumentIndexProvider documentIndexProvider, IPluginContext pluginContext, IActivityLogger logger, SagaServices sagaServices)
 {
     _entityIndexer         = entityIndexer;
     _entityTypesProvider   = entityTypesProvider;
     _documentIndexProvider = documentIndexProvider;
     _pluginContext         = pluginContext;
     _logger              = logger;
     _sagaServices        = sagaServices;
     _generalsIndexing    = new GeneralsIndexing(_entityIndexer, () => Data, _entityTypesProvider, d => _assignablesIndexing.Start(), q => Send(q), _logger);
     _assignablesIndexing = new AssignablesIndexing(_entityIndexer, () => Data, _entityTypesProvider, d => _testCasesIndexing.Start(), q => Send(q), _logger);
     _testCasesIndexing   = new TestCasesIndexing(_entityIndexer, () => Data, _entityTypesProvider, d => _impedimentsIndexing.Start(), q => Send(q), _logger);
     _impedimentsIndexing = new ImpedimentsIndexing(_entityIndexer, () => Data, _entityTypesProvider, d => _commentsIndexing.Start(), q => Send(q), _logger);
     _commentsIndexing    = new CommentsIndexing(_entityIndexer, () => Data, _entityTypesProvider, d =>
     {
         SendLocal(new IndexExistingEntitiesDoneLocalMessage {
             SagaId = Data.OuterSagaId
         });
         MarkAsComplete();
     }, q => Send(q), _logger, (dto, indexer) => indexer.AddCommentIndex(dto, DocumentIndexOptimizeSetup.NoOptimize));
 }