Search in sources :

Example 1 with RulesSemanticModule

use of org.drools.compiler.compiler.xml.RulesSemanticModule in project drools by kiegroup.

the class KnowledgeBuilderConfigurationImpl method initSemanticModules.

public void initSemanticModules() {
    this.semanticModules = new SemanticModules();
    RulesSemanticModule ruleModule = new RulesSemanticModule("http://ddefault");
    this.semanticModules.addSemanticModule(new WrapperSemanticModule("http://drools.org/drools-5.0", ruleModule));
    this.semanticModules.addSemanticModule(new WrapperSemanticModule("http://drools.org/drools-5.2", ruleModule));
    this.semanticModules.addSemanticModule(new ChangeSetSemanticModule());
    // split on each space
    String[] locations = this.chainedProperties.getProperty("semanticModules", "").split("\\s");
    // load each SemanticModule
    for (String moduleLocation : locations) {
        // trim leading/trailing spaces and quotes
        moduleLocation = moduleLocation.trim();
        if (moduleLocation.startsWith("\"")) {
            moduleLocation = moduleLocation.substring(1);
        }
        if (moduleLocation.endsWith("\"")) {
            moduleLocation = moduleLocation.substring(0, moduleLocation.length() - 1);
        }
        if (!moduleLocation.equals("")) {
            loadSemanticModule(moduleLocation);
        }
    }
}
Also used : SemanticModules(org.drools.core.xml.SemanticModules) ChangeSetSemanticModule(org.drools.core.xml.ChangeSetSemanticModule) RulesSemanticModule(org.drools.compiler.compiler.xml.RulesSemanticModule) WrapperSemanticModule(org.drools.core.xml.WrapperSemanticModule)

Aggregations

RulesSemanticModule (org.drools.compiler.compiler.xml.RulesSemanticModule)1 ChangeSetSemanticModule (org.drools.core.xml.ChangeSetSemanticModule)1 SemanticModules (org.drools.core.xml.SemanticModules)1 WrapperSemanticModule (org.drools.core.xml.WrapperSemanticModule)1