@Override public TranslationProcess execute() { final TranslationProcess process = this.process; final Integer i = Integer.valueOf(getParams().getAttributes()[0]); TransactionTemplate transactionTemplate = new TransactionTemplate(txManager); transactionTemplate.execute( status -> { DictionaryWord word = process.getWords().get(i); String filename = fileService.createFile(word.toString()); TransactionSynchronizationManager.registerSynchronization( new FileRollbackHandler(filename)); repository.addWord(word); return null; // To change body of implemented methods use File | Settings | File // Templates. }); return process; }
public SaveWordsCommand() { super(TranslationProcess.fromCommandParameters(new CommandParameters("save"))); }