class-templates.SessionRuleUnitTemplate Maven / Gradle / Ivy
package org.drools.project.model;
import org.kie.kogito.rules.KieRuntimeBuilder;
import org.kie.kogito.rules.impl.SessionMemory;
import org.drools.modelcompiler.SessionRuleUnitInstance;
import org.kie.kogito.rules.RuleUnit;
@javax.inject.Singleton
@javax.inject.Named("$SessionName$")
public class SessionRuleUnit implements RuleUnit {
@javax.inject.Inject
KieRuntimeBuilder runtimeBuilder;
@Override
public SessionRuleUnitInstance createInstance( SessionMemory memory ) {
return new SessionRuleUnitInstance(this, memory, runtimeBuilder.newKieSession("$SessionName$"));
}
}