use of org.guvnor.ala.ui.exceptions.ServiceException in project kie-wb-common by kiegroup.
the class RuntimeServiceImpl method validateForCreateRuntime.
private void validateForCreateRuntime(final ProviderKey providerKey, final String runtimeName) {
final Provider provider = providerService.getProvider(providerKey);
if (provider == null) {
// uncommon case
logger.error("No provider was found for providerKey: " + providerKey);
throw new ServiceException("No provider was found for providerKey: " + providerKey);
}
final Collection<RuntimeQueryResultItem> items = runtimeProvisioningService.executeQuery(RuntimeQueryBuilder.newInstance().withRuntimeName(runtimeName).build());
if (!items.isEmpty()) {
throw new ServiceException("A runtime with the given name already exists: " + runtimeName);
}
}
Aggregations