Search in sources :

Example 1 with DMNRuntimeKB

use of org.kie.dmn.core.impl.DMNRuntimeKB in project drools by kiegroup.

the class DMNKiePMMLTrustyInvocationEvaluator method getPMMLRuntime.

/**
 * @param eventManager
 * @return
 */
private PMMLRuntime getPMMLRuntime(DMNRuntimeEventManager eventManager) {
    DMNRuntimeImpl dmnRuntime = (DMNRuntimeImpl) eventManager.getRuntime();
    final DMNRuntimeKB runtimeKB = dmnRuntime.getRuntimeKB();
    if (runtimeKB instanceof DMNRuntimeKBWrappingIKB) {
        // We are in drools
        return getPMMLRuntimeFromDMNRuntimeKBWrappingIKB((DMNRuntimeKBWrappingIKB) runtimeKB);
    } else {
        // we are in kogito
        KieRuntimeFactory kieFactory = dmnRuntime.getKieRuntimeFactory(model);
        return kieFactory.get(PMMLRuntime.class);
    }
}
Also used : KieRuntimeFactory(org.kie.api.runtime.KieRuntimeFactory) DMNRuntimeKB(org.kie.dmn.core.impl.DMNRuntimeKB) DMNRuntimeImpl(org.kie.dmn.core.impl.DMNRuntimeImpl) DMNRuntimeKBWrappingIKB(org.kie.dmn.core.impl.DMNRuntimeKBWrappingIKB)

Aggregations

KieRuntimeFactory (org.kie.api.runtime.KieRuntimeFactory)1 DMNRuntimeImpl (org.kie.dmn.core.impl.DMNRuntimeImpl)1 DMNRuntimeKB (org.kie.dmn.core.impl.DMNRuntimeKB)1 DMNRuntimeKBWrappingIKB (org.kie.dmn.core.impl.DMNRuntimeKBWrappingIKB)1