return result;
}
@Override
public void addGlobal(String className, String name) throws RuleBaseException {
GlobalDeclaration globalDeclaration = new GlobalDeclaration(name);
Map<String, String> metaData = globalDeclaration.toMetadata();
List<GlobalConfiguration> queryResult;
try {
queryResult = globalPersistence.load(metaData);
} catch (PersistenceException e) {
throw new RuleBaseException(e);
}
if (!queryResult.isEmpty()) {
throw new RuleBaseException(String.format("Global with name \"%s\" already exists", name));
}
globalDeclaration.setClassName(className);
GlobalConfiguration cnf = new GlobalConfiguration(metaData, globalDeclaration);
try {
globalPersistence.persist(cnf);
} catch (PersistenceException e) {
throw new RuleBaseException(e);