Search in sources :

Example 1 with KieBaseOption

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());
}
Also used : KieBaseConfiguration(org.kie.api.KieBaseConfiguration) KiePackagesBuilder(org.drools.modelcompiler.KiePackagesBuilder) KieBaseOption(org.kie.api.conf.KieBaseOption)

Aggregations

KiePackagesBuilder (org.drools.modelcompiler.KiePackagesBuilder)1 KieBaseConfiguration (org.kie.api.KieBaseConfiguration)1 KieBaseOption (org.kie.api.conf.KieBaseOption)1