Search in sources :

Example 36 with KnowledgePackageImpl

use of org.drools.core.definitions.impl.KnowledgePackageImpl in project drools by kiegroup.

the class RuleBaseEventSupportTest method setUp.

/* (non-Javadoc)
     * @see junit.framework.TestCase#setUp()
     */
@Before
public void setUp() throws Exception {
    kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase();
    listener1 = new TestRuleBaseListener("(listener-1) ");
    listener2 = new TestRuleBaseListener("(listener-2) ");
    kBase.addEventListener(listener1);
    kBase.addEventListener(listener2);
    final RuleImpl rule1 = new RuleImpl("test1");
    final ClassObjectType cheeseObjectType = new ClassObjectType(Cheese.class);
    final Pattern pattern = new Pattern(0, cheeseObjectType);
    ClassFieldAccessorStore store = new ClassFieldAccessorStore();
    store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
    store.setEagerWire(true);
    final ClassFieldReader extractor = store.getReader(Cheese.class, "type");
    final FieldValue field = FieldFactory.getInstance().getFieldValue("cheddar");
    final MvelConstraint constraint = new MvelConstraintTestUtil("type == \"cheddar\"", field, extractor);
    pattern.addConstraint(constraint);
    rule1.addPattern(pattern);
    rule1.setConsequence(new Consequence() {

        private static final long serialVersionUID = 510l;

        public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) throws Exception {
        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        }

        public void writeExternal(ObjectOutput out) throws IOException {
        }

        public String getName() {
            return "default";
        }
    });
    final RuleImpl rule2 = new RuleImpl("test2");
    final ClassObjectType cheeseObjectType2 = new ClassObjectType(Cheese.class);
    final Pattern pattern2 = new Pattern(0, cheeseObjectType2);
    final FieldValue field2 = FieldFactory.getInstance().getFieldValue("stilton");
    final MvelConstraint constraint2 = new MvelConstraintTestUtil("type == \"stilton\"", field, extractor);
    pattern2.addConstraint(constraint2);
    rule2.addPattern(pattern2);
    rule2.setConsequence(new Consequence() {

        private static final long serialVersionUID = 510l;

        public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) throws Exception {
        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        }

        public void writeExternal(ObjectOutput out) throws IOException {
        }

        public String getName() {
            return "default";
        }
    });
    pkg = new KnowledgePackageImpl("org.drools.test1");
    pkg.addRule(rule1);
    pkg.addRule(rule2);
}
Also used : Pattern(org.drools.core.rule.Pattern) ClassObjectType(org.drools.core.base.ClassObjectType) ObjectOutput(java.io.ObjectOutput) WorkingMemory(org.drools.core.WorkingMemory) MvelConstraint(org.drools.core.rule.constraint.MvelConstraint) Consequence(org.drools.core.spi.Consequence) RuleImpl(org.drools.core.definitions.rule.impl.RuleImpl) ClassFieldAccessorStore(org.drools.core.base.ClassFieldAccessorStore) IOException(java.io.IOException) MvelConstraintTestUtil(org.drools.core.rule.MvelConstraintTestUtil) IOException(java.io.IOException) ClassFieldAccessorCache(org.drools.core.base.ClassFieldAccessorCache) ClassFieldReader(org.drools.core.base.ClassFieldReader) KnowledgeHelper(org.drools.core.spi.KnowledgeHelper) FieldValue(org.drools.core.spi.FieldValue) ObjectInput(java.io.ObjectInput) KnowledgePackageImpl(org.drools.core.definitions.impl.KnowledgePackageImpl) Before(org.junit.Before)

Example 37 with KnowledgePackageImpl

use of org.drools.core.definitions.impl.KnowledgePackageImpl in project drools by kiegroup.

the class KnowledgeBaseEventSupportTest method setUp.

/* (non-Javadoc)
     * @see junit.framework.TestCase#setUp()
     */
@Before
public void setUp() throws Exception {
    kbase = KnowledgeBaseFactory.newKnowledgeBase();
    listener1 = new TestRuleBaseListener("(listener-1) ");
    listener2 = new TestRuleBaseListener("(listener-2) ");
    kbase.addEventListener(listener1);
    kbase.addEventListener(listener2);
    final RuleImpl rule1 = new RuleImpl("test1");
    final ClassObjectType cheeseObjectType = new ClassObjectType(Cheese.class);
    final Pattern pattern = new Pattern(0, cheeseObjectType);
    ClassFieldAccessorStore store = new ClassFieldAccessorStore();
    store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
    store.setEagerWire(true);
    final ClassFieldReader extractor = store.getReader(Cheese.class, "type");
    final FieldValue field = FieldFactory.getInstance().getFieldValue("cheddar");
    final MvelConstraint constraint = new MvelConstraintTestUtil("type == \"cheddar\"", field, extractor);
    pattern.addConstraint(constraint);
    rule1.addPattern(pattern);
    rule1.setConsequence(new Consequence() {

        private static final long serialVersionUID = 510l;

        public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) throws Exception {
        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        }

        public void writeExternal(ObjectOutput out) throws IOException {
        }

        public String getName() {
            return "default";
        }
    });
    final RuleImpl rule2 = new RuleImpl("test2");
    final ClassObjectType cheeseObjectType2 = new ClassObjectType(Cheese.class);
    final Pattern pattern2 = new Pattern(0, cheeseObjectType2);
    final FieldValue field2 = FieldFactory.getInstance().getFieldValue("stilton");
    final MvelConstraint constraint2 = new MvelConstraintTestUtil("type == \"stilton\"", field, extractor);
    pattern2.addConstraint(constraint2);
    rule2.addPattern(pattern2);
    rule2.setConsequence(new Consequence() {

        private static final long serialVersionUID = 510l;

        public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) throws Exception {
        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        }

        public void writeExternal(ObjectOutput out) throws IOException {
        }

        public String getName() {
            return "default";
        }
    });
    pkg = new KnowledgePackageImpl("org.drools.test1");
    pkg.addRule(rule1);
    pkg.addRule(rule2);
}
Also used : Pattern(org.drools.core.rule.Pattern) ClassObjectType(org.drools.core.base.ClassObjectType) ObjectOutput(java.io.ObjectOutput) WorkingMemory(org.drools.core.WorkingMemory) MvelConstraint(org.drools.core.rule.constraint.MvelConstraint) Consequence(org.drools.core.spi.Consequence) RuleImpl(org.drools.core.definitions.rule.impl.RuleImpl) ClassFieldAccessorStore(org.drools.core.base.ClassFieldAccessorStore) IOException(java.io.IOException) MvelConstraintTestUtil(org.drools.core.rule.MvelConstraintTestUtil) IOException(java.io.IOException) ClassFieldAccessorCache(org.drools.core.base.ClassFieldAccessorCache) ClassFieldReader(org.drools.core.base.ClassFieldReader) KnowledgeHelper(org.drools.core.spi.KnowledgeHelper) FieldValue(org.drools.core.spi.FieldValue) ObjectInput(java.io.ObjectInput) KnowledgePackageImpl(org.drools.core.definitions.impl.KnowledgePackageImpl) Before(org.junit.Before)

Example 38 with KnowledgePackageImpl

use of org.drools.core.definitions.impl.KnowledgePackageImpl in project drools by kiegroup.

the class AgendaEventSupportTest method testAgendaEventListener.

// public void testIsSerializable() {
// assertTrue( Serializable.class.isAssignableFrom( AgendaEventSupport.class ) );
// }
@Test
@Ignore
public void testAgendaEventListener() throws Exception {
    InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
    // create a simple package with one rule to test the events
    InternalKnowledgePackage pkg = new KnowledgePackageImpl("org.drools.test");
    final RuleImpl rule = new RuleImpl("test1");
    rule.setEager(true);
    rule.setAgendaGroup("test group");
    final ClassObjectType cheeseObjectType = new ClassObjectType(Cheese.class);
    final Pattern pattern = new Pattern(0, cheeseObjectType);
    pkg.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
    pkg.getClassFieldAccessorStore().setEagerWire(true);
    final ClassFieldReader extractor = pkg.getClassFieldAccessorStore().getReader(Cheese.class, "type");
    final FieldValue field = FieldFactory.getInstance().getFieldValue("cheddar");
    final MvelConstraint constraint = new MvelConstraintTestUtil("type == \"cheddar\"", field, extractor);
    pattern.addConstraint(constraint);
    rule.addPattern(pattern);
    rule.setConsequence(new Consequence() {

        public void evaluate(final KnowledgeHelper knowledgeHelper, final WorkingMemory workingMemory) throws Exception {
        }

        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        }

        public void writeExternal(ObjectOutput out) throws IOException {
        }

        public String getName() {
            // TODO Auto-generated method stub
            return null;
        }
    });
    pkg.addRule(rule);
    kbase.addPackages(Collections.singleton(pkg));
    // create a new working memory and add an AgendaEventListener
    KieSession ksession = kbase.newKieSession();
    final List agendaList = new ArrayList();
    final AgendaEventListener agendaEventListener = new AgendaEventListener() {

        public void matchCancelled(MatchCancelledEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void matchCreated(MatchCreatedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void afterMatchFired(AfterMatchFiredEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void agendaGroupPopped(AgendaGroupPoppedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void agendaGroupPushed(AgendaGroupPushedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void beforeMatchFired(BeforeMatchFiredEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }

        public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event) {
            assertNotNull(event.getKieRuntime());
            agendaList.add(event);
        }
    };
    ksession.addEventListener(agendaEventListener);
    assertEquals(1, ksession.getAgendaEventListeners().size());
    // assert the cheese fact
    final Cheese cheddar = new Cheese("cheddar", 15);
    FactHandle cheddarHandle = ksession.insert(cheddar);
    InternalAgenda agenda = (InternalAgenda) ksession.getAgenda();
    agenda.evaluateEagerList();
    // should be one MatchCreatedEvent
    assertEquals(1, agendaList.size());
    MatchCreatedEvent createdEvent = (MatchCreatedEvent) agendaList.get(0);
    assertSame(cheddarHandle, createdEvent.getMatch().getFactHandles().toArray()[0]);
    // clear the agenda to check CLEAR events occur
    ksession.getAgenda().clear();
    MatchCancelledEvent cancelledEvent = (MatchCancelledEvent) agendaList.get(1);
    assertEquals(MatchCancelledCause.CLEAR, cancelledEvent.getCause());
    agendaList.clear();
    // update results in an MatchCreatedEvent
    cheddar.setPrice(14);
    ksession.update(cheddarHandle, cheddar);
    agenda.evaluateEagerList();
    assertEquals(1, agendaList.size());
    createdEvent = (MatchCreatedEvent) agendaList.get(0);
    assertSame(cheddarHandle, createdEvent.getMatch().getFactHandles().toArray()[0]);
    agendaList.clear();
    // update should not result in cancelation+activation events
    cheddar.setPrice(14);
    ksession.update(cheddarHandle, cheddar);
    assertEquals(0, agendaList.size());
    // cancelledEvent = (ActivationCancelledEvent) agendaList.get( 0 );
    // assertEquals( ActivationCancelledCause.WME_MODIFY, cancelledEvent.getCause() );
    // assertSame( cheddarHandle,
    // cancelledEvent.getActivation().toFactHandles().toArray()[0] );
    // createdEvent = (ActivationCreatedEvent) agendaList.get( 1 );
    // assertSame( cheddarHandle,
    // createdEvent.getActivation().toFactHandles().toArray()[0] );
    // agendaList.clear();
    // retract results in a ActivationCancelledEvent, note the object is not resolveable now as it no longer exists
    ksession.retract(cheddarHandle);
    assertEquals(1, agendaList.size());
    cancelledEvent = (MatchCancelledEvent) agendaList.get(0);
    // invalidated handles no longer set the object to null
    assertNotNull(((InternalFactHandle) cancelledEvent.getMatch().getFactHandles().toArray()[0]).getObject());
    // re-assert the fact so we can test the agenda group events
    cheddarHandle = ksession.insert(cheddar);
    agendaList.clear();
    // setFocus results in an AgendaGroupPushedEvent
    ksession.getAgenda().getAgendaGroup("test group").setFocus();
    assertEquals(1, agendaList.size());
    final AgendaGroupPushedEvent pushedEvent = (AgendaGroupPushedEvent) agendaList.get(0);
    assertEquals("test group", pushedEvent.getAgendaGroup().getName());
    agendaList.clear();
    // fireAllRules results in a BeforeActivationFiredEvent and an AfterActivationFiredEvent
    // the AgendaGroup becomes empty, which results in a popped event.
    ksession.fireAllRules();
    assertEquals(3, agendaList.size());
    final BeforeMatchFiredEvent beforeEvent = (BeforeMatchFiredEvent) agendaList.get(0);
    assertSame(cheddarHandle, beforeEvent.getMatch().getFactHandles().toArray()[0]);
    final AfterMatchFiredEvent afterEvent = (AfterMatchFiredEvent) agendaList.get(1);
    assertSame(cheddarHandle, afterEvent.getMatch().getFactHandles().toArray()[0]);
    final AgendaGroupPoppedEvent poppedEvent = (AgendaGroupPoppedEvent) agendaList.get(2);
    assertEquals("test group", poppedEvent.getAgendaGroup().getName());
}
Also used : ClassObjectType(org.drools.core.base.ClassObjectType) InternalFactHandle(org.drools.core.common.InternalFactHandle) FactHandle(org.kie.api.runtime.rule.FactHandle) WorkingMemory(org.drools.core.WorkingMemory) MvelConstraint(org.drools.core.rule.constraint.MvelConstraint) ArrayList(java.util.ArrayList) RuleImpl(org.drools.core.definitions.rule.impl.RuleImpl) Cheese(org.drools.core.test.model.Cheese) RuleFlowGroupDeactivatedEvent(org.kie.api.event.rule.RuleFlowGroupDeactivatedEvent) MvelConstraintTestUtil(org.drools.core.rule.MvelConstraintTestUtil) InternalAgenda(org.drools.core.common.InternalAgenda) ClassFieldReader(org.drools.core.base.ClassFieldReader) MatchCancelledEvent(org.kie.api.event.rule.MatchCancelledEvent) AgendaEventListener(org.kie.api.event.rule.AgendaEventListener) BeforeMatchFiredEvent(org.kie.api.event.rule.BeforeMatchFiredEvent) KnowledgeHelper(org.drools.core.spi.KnowledgeHelper) KieSession(org.kie.api.runtime.KieSession) ArrayList(java.util.ArrayList) List(java.util.List) FieldValue(org.drools.core.spi.FieldValue) MatchCreatedEvent(org.kie.api.event.rule.MatchCreatedEvent) InternalKnowledgeBase(org.drools.core.impl.InternalKnowledgeBase) Pattern(org.drools.core.rule.Pattern) ObjectOutput(java.io.ObjectOutput) Consequence(org.drools.core.spi.Consequence) IOException(java.io.IOException) IOException(java.io.IOException) AfterMatchFiredEvent(org.kie.api.event.rule.AfterMatchFiredEvent) ClassFieldAccessorCache(org.drools.core.base.ClassFieldAccessorCache) AgendaGroupPoppedEvent(org.kie.api.event.rule.AgendaGroupPoppedEvent) RuleFlowGroupActivatedEvent(org.kie.api.event.rule.RuleFlowGroupActivatedEvent) AgendaGroupPushedEvent(org.kie.api.event.rule.AgendaGroupPushedEvent) ObjectInput(java.io.ObjectInput) KnowledgePackageImpl(org.drools.core.definitions.impl.KnowledgePackageImpl) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 39 with KnowledgePackageImpl

use of org.drools.core.definitions.impl.KnowledgePackageImpl in project drools by kiegroup.

the class BaseMannersTest method setUp.

@Before
public void setUp() throws Exception {
    // Class shadow = ShadowProxyFactory.getProxy( Context.class );
    this.contextType = new ClassObjectType(Context.class);
    // shadow = ShadowProxyFactory.getProxy( Guest.class );
    this.guestType = new ClassObjectType(Guest.class);
    // shadow = ShadowProxyFactory.getProxy( Seating.class );
    this.seatingType = new ClassObjectType(Seating.class);
    // shadow = ShadowProxyFactory.getProxy( LastSeat.class );
    this.lastSeatType = new ClassObjectType(LastSeat.class);
    // shadow = ShadowProxyFactory.getProxy( Count.class );
    this.countType = new ClassObjectType(Count.class);
    // shadow = ShadowProxyFactory.getProxy( Path.class );
    this.pathType = new ClassObjectType(Path.class);
    // shadow = ShadowProxyFactory.getProxy( Chosen.class );
    this.chosenType = new ClassObjectType(Chosen.class);
    this.pkg = new KnowledgePackageImpl("org.drools.examples.manners");
    this.pkg.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
    store = this.pkg.getClassFieldAccessorStore();
    store.setEagerWire(true);
    this.pkg.addRule(getAssignFirstSeatRule());
    this.pkg.addRule(getFindSeating());
    this.pkg.addRule(getMakePath());
    this.pkg.addRule(getPathDone());
    this.pkg.addRule(getContinueProcessing());
    this.pkg.addRule(getAreWeDone());
    this.pkg.addRule(getAllDone());
}
Also used : ClassFieldAccessorCache(org.drools.core.base.ClassFieldAccessorCache) ClassObjectType(org.drools.core.base.ClassObjectType) KnowledgePackageImpl(org.drools.core.definitions.impl.KnowledgePackageImpl) Before(org.junit.Before)

Example 40 with KnowledgePackageImpl

use of org.drools.core.definitions.impl.KnowledgePackageImpl in project drools by kiegroup.

the class MVELConsequenceBuilderTest method setupTest.

private void setupTest(String consequence, Map<String, Object> namedConsequences) {
    builder = new MVELConsequenceBuilder();
    InternalKnowledgePackage pkg = new KnowledgePackageImpl("org.drools.compiler.test");
    pkg.addImport(new ImportDeclaration(Cheese.class.getCanonicalName()));
    KnowledgeBuilderConfigurationImpl conf = new KnowledgeBuilderConfigurationImpl();
    KnowledgeBuilderImpl pkgBuilder = new KnowledgeBuilderImpl(pkg, conf);
    ruleDescr = new RuleDescr("test consequence builder");
    ruleDescr.setConsequence(consequence);
    ruleDescr.addAttribute(new AttributeDescr("dialect", "mvel"));
    for (Entry<String, Object> entry : namedConsequences.entrySet()) {
        ruleDescr.addNamedConsequences(entry.getKey(), entry.getValue());
    }
    RuleImpl rule = new RuleImpl(ruleDescr.getName());
    rule.addPattern(new Pattern(0, new ClassObjectType(Cheese.class), "$cheese"));
    rule.addPattern(new Pattern(0, new ClassObjectType(Map.class), "$map"));
    PackageRegistry pkgRegistry = pkgBuilder.getPackageRegistry(pkg.getName());
    DialectCompiletimeRegistry reg = pkgBuilder.getPackageRegistry(pkg.getName()).getDialectCompiletimeRegistry();
    context = new RuleBuildContext(pkgBuilder, ruleDescr, reg, pkg, reg.getDialect(pkgRegistry.getDialect()));
    context.getDeclarationResolver().pushOnBuildStack(rule.getLhs());
    context.getDialect().getConsequenceBuilder().build(context, RuleImpl.DEFAULT_CONSEQUENCE_NAME);
    for (String name : namedConsequences.keySet()) {
        context.getDialect().getConsequenceBuilder().build(context, name);
    }
    context.getDialect().addRule(context);
    pkgRegistry.getPackage().addRule(context.getRule());
    pkgBuilder.compileAll();
    pkgBuilder.reloadAll();
    if (pkgBuilder.hasErrors()) {
        fail(pkgBuilder.getErrors().toString());
    }
}
Also used : Pattern(org.drools.core.rule.Pattern) ClassObjectType(org.drools.core.base.ClassObjectType) RuleBuildContext(org.drools.compiler.rule.builder.RuleBuildContext) KnowledgeBuilderConfigurationImpl(org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl) DialectCompiletimeRegistry(org.drools.compiler.compiler.DialectCompiletimeRegistry) RuleImpl(org.drools.core.definitions.rule.impl.RuleImpl) PackageRegistry(org.drools.compiler.compiler.PackageRegistry) KnowledgeBuilderImpl(org.drools.compiler.builder.impl.KnowledgeBuilderImpl) ImportDeclaration(org.drools.core.rule.ImportDeclaration) RuleDescr(org.drools.compiler.lang.descr.RuleDescr) KnowledgePackageImpl(org.drools.core.definitions.impl.KnowledgePackageImpl) AttributeDescr(org.drools.compiler.lang.descr.AttributeDescr) InternalKnowledgePackage(org.drools.core.definitions.InternalKnowledgePackage)

Aggregations

KnowledgePackageImpl (org.drools.core.definitions.impl.KnowledgePackageImpl)41 InternalKnowledgePackage (org.drools.core.definitions.InternalKnowledgePackage)26 Test (org.junit.Test)19 RuleImpl (org.drools.core.definitions.rule.impl.RuleImpl)18 ClassObjectType (org.drools.core.base.ClassObjectType)13 Pattern (org.drools.core.rule.Pattern)11 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)9 ClassFieldAccessorCache (org.drools.core.base.ClassFieldAccessorCache)9 RuleDescr (org.drools.compiler.lang.descr.RuleDescr)8 WorkingMemory (org.drools.core.WorkingMemory)7 Consequence (org.drools.core.spi.Consequence)7 KnowledgeHelper (org.drools.core.spi.KnowledgeHelper)7 KnowledgeBuilderConfigurationImpl (org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl)6 DialectCompiletimeRegistry (org.drools.compiler.compiler.DialectCompiletimeRegistry)6 RuleBuildContext (org.drools.compiler.rule.builder.RuleBuildContext)6 Declaration (org.drools.core.rule.Declaration)6 InternalReadAccessor (org.drools.core.spi.InternalReadAccessor)6 IOException (java.io.IOException)5 PackageRegistry (org.drools.compiler.compiler.PackageRegistry)5 KnowledgeBaseImpl (org.drools.core.impl.KnowledgeBaseImpl)5