import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
+
+ UpdateResult result;
try {
- newNode = (TaxonNode) CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(),
+ result = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(),
element.getUuid(),
parentNode.getUuid(),
- true).getCdmEntity();
+ true);
+ if (result.isAbort()){
+
+ MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonOperation_INCONSISTENT_DATA, getClass(), result.toString());
+ return postExecute(null);
+ }
+ newNode = (TaxonNode) result.getCdmEntity();
} catch (HomotypicalGroupChangeException e) {
- MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonOperation_INCONSISTENT_DATA, getClass(), e.getMessage());
- return postExecute(null);
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
+
+
monitor.worked(20);
//newTaxon = (Taxon) CdmStore.getService(ITaxonService.class).merge(newTaxon);
//element.removeSynonym(synonym);