code: @Override
      public SystemState restore(long fromVersion, TxRepository repository) {
          workflowContext.repository(repository);
          final long snapshotTransactionId = repository.getO(SystemInfo.class, 0L).orElse(new SystemInfo(0L)).lastTransactionId;
          final long[] transactionId = {snapshotTransactionId};
          try (InputProcessor processor = new DefaultInputProcessor(journalStorage)) {
              processor.process(fromVersion, b -> {
                  EventsCommitInfo e = eventsContext.serializer().deserialize(eventsContext.eventsCommitBuilder(), b);
                  eventBus.processNextEvent(e);
              }, JournalType.EVENTS);
              processor.process(fromVersion, b -> {
                  TransactionCommitInfo tx = workflowContext.serializer().deserialize(workflowContext.transactionCommitBuilder(), b);
                  if (tx.transactionId() > transactionId[0] || tx.transactionId() == snapshotTransactionId) {
                      transactionId[0] = tx.transactionId();
                      workflowEngine.getPipe().executeRestore(eventBus, tx);
                  } else if (LOG.isDebugEnabled()) {
                      LOG.debug("Transaction ID {} less than last Transaction ID {}", tx.transactionId(), transactionId[0]);
                  }
              }, JournalType.TRANSACTIONS);
          } catch (Throwable t) {
              LOG.error("restore", t);
              throw new RuntimeException(t);
          }
          workflowEngine.getPipe().sync();
          workflowContext.eventPublisher().getPipe().sync();
          return new SystemState(transactionId[0]);
      }
docs: Reads all journals and restores all previous system mode state from them
  into the given repository. Also, re-publish all events that were not sent
  by the reason of failure, abortion, etc.
  
  @param repository into which latest state of model will be loaded
  @return information about last system state, such as last transactionId, etc.