Search in sources :

Example 1 with WrapperSemanticModule

use of org.jbpm.compiler.xml.core.WrapperSemanticModule in project kogito-runtimes by kiegroup.

the class SemanticKnowledgeBuilderConfigurationImpl 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));
    // split on each space
    String[] locations = getChainedProperties().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.jbpm.compiler.xml.core.SemanticModules) WrapperSemanticModule(org.jbpm.compiler.xml.core.WrapperSemanticModule)

Aggregations

SemanticModules (org.jbpm.compiler.xml.core.SemanticModules)1 WrapperSemanticModule (org.jbpm.compiler.xml.core.WrapperSemanticModule)1