List of usage examples for com.liferay.portal.kernel.exception ModelListenerException ModelListenerException
public ModelListenerException(String msg, Throwable cause)
From source file:com.liferay.exportimport.internal.model.listener.BackgroundTaskModelListener.java
License:Open Source License
@Override public void onBeforeRemove(BackgroundTask backgroundTask) throws ModelListenerException { Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap(); long exportImportConfigurationId = MapUtil.getLong(taskContextMap, "exportImportConfigurationId"); if (exportImportConfigurationId == 0) { return;//from w w w . jav a2 s . co m } try { ExportImportConfiguration exportImportConfiguration = _exportImportConfigurationLocalService .fetchExportImportConfiguration(exportImportConfigurationId); if (exportImportConfiguration == null) { return; } if (exportImportConfiguration.getStatus() == WorkflowConstants.STATUS_DRAFT) { _exportImportConfigurationLocalService.deleteExportImportConfiguration(exportImportConfiguration); } } catch (Exception e) { throw new ModelListenerException("Unable to delete the process configuration for background " + "task " + backgroundTask.getBackgroundTaskId(), e); } }