// If we don't use this config, then all rules' LHS object conditions will not match on .esb redeploys!
// (since objects are only equal if their ClassLoaders are also equal - and they're not on redeploys..)
final Properties properties = new Properties();
properties.setProperty(ClassLoaderCacheOption.PROPERTY_NAME, Boolean.FALSE.toString());
final ClassLoader classLoader = new RulesClassLoader(ruleInfo.getRuleSource());
KnowledgeBaseConfiguration kbaseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(properties, classLoader);
// CEP
StringValue eventProcessingType = RULE_EVENT_PROCESSING_TYPE.getStringValue(ruleInfo.getEventProcessingType());
if (STREAM.equals(eventProcessingType))
{
kbaseConfig.setOption(EventProcessingOption.STREAM);
}
else if (CLOUD.equals(eventProcessingType))
{
kbaseConfig.setOption(EventProcessingOption.CLOUD);
}
Boolean multithreadEvaluation = ruleInfo.getMultithreadEvaluation();
if (multithreadEvaluation != null) {
MultithreadEvaluationOption meo = multithreadEvaluation.booleanValue() ? MultithreadEvaluationOption.YES : MultithreadEvaluationOption.NO;
kbaseConfig.setOption(meo);
// only pertinent if multithreadEvaluation == true
Integer maxThreads = ruleInfo.getMaxThreads();
if (maxThreads != null) {
kbaseConfig.setOption(MaxThreadsOption.get(maxThreads.intValue()));
}
}
KnowledgeBase ruleBase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
try