use of org.kie.api.conf.KieBaseOption in project drools by kiegroup.
the class KieBaseBuilder method createKieBaseFromModel.
public static InternalKnowledgeBase createKieBaseFromModel(Model model, KieBaseOption... options) {
KieBaseConfiguration kieBaseConf = KieServices.get().newKieBaseConfiguration();
if (options == null || options.length == 0) {
for (KieBaseOption option : options) {
kieBaseConf.setOption(option);
}
}
KiePackagesBuilder builder = new KiePackagesBuilder(kieBaseConf, ProjectClassLoader.createProjectClassLoader(kieBaseConf.getClass().getClassLoader()));
builder.addModel(model);
return new KieBaseBuilder(kieBaseConf).createKieBase(builder.build());
}
Aggregations