Search in sources :

Example 11 with ResourceTypePackage

use of org.kie.api.internal.io.ResourceTypePackage in project drools by kiegroup.

the class DMNRuntimeImpl method getModel.

@Override
public DMNModel getModel(String namespace, String modelName) {
    InternalKnowledgePackage kpkg = (InternalKnowledgePackage) runtime.getKieBase().getKiePackage(namespace);
    if (kpkg == null) {
        return null;
    }
    Map<ResourceType, ResourceTypePackage> map = kpkg.getResourceTypePackages();
    DMNPackage dmnpkg = (DMNPackage) map.get(ResourceType.DMN);
    return dmnpkg != null ? dmnpkg.getModel(modelName) : null;
}
Also used : DMNPackage(org.kie.dmn.api.core.DMNPackage) ResourceType(org.kie.api.io.ResourceType) ResourceTypePackage(org.kie.api.internal.io.ResourceTypePackage) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage)

Aggregations

ResourceTypePackage (org.kie.api.internal.io.ResourceTypePackage)11 ResourceType (org.kie.api.io.ResourceType)10 InternalKnowledgePackage (org.drools.core.definitions.InternalKnowledgePackage)8 Map (java.util.Map)3 BayesPackage (org.drools.beliefs.bayes.assembler.BayesPackage)3 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)3 PackageRegistry (org.drools.compiler.compiler.PackageRegistry)3 RuleImpl (org.drools.core.definitions.rule.impl.RuleImpl)3 WindowDeclaration (org.drools.core.rule.WindowDeclaration)3 DMNModel (org.kie.dmn.api.core.DMNModel)3 DMNPackageImpl (org.kie.dmn.core.impl.DMNPackageImpl)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 JunctionTree (org.drools.beliefs.bayes.JunctionTree)2 PackageDescr (org.drools.compiler.lang.descr.PackageDescr)2 Function (org.drools.core.rule.Function)2 ImportDeclaration (org.drools.core.rule.ImportDeclaration)2 Process (org.kie.api.definition.process.Process)2 Rule (org.kie.api.definition.rule.Rule)2