Search in sources :

Example 6 with InternalAgendaGroup

use of org.drools.core.common.InternalAgendaGroup in project drools by kiegroup.

the class PathMemory method queueRuleAgendaItem.

public void queueRuleAgendaItem(InternalAgenda agenda) {
    agendaItem.getRuleExecutor().setDirty(true);
    ActivationsFilter activationFilter = agenda.getActivationsFilter();
    if (activationFilter != null && !activationFilter.accept(agendaItem, agenda.getWorkingMemory(), agendaItem.getTerminalNode())) {
        return;
    }
    if (!agendaItem.isQueued()) {
        if (isLogTraceEnabled) {
            log.trace("Queue RuleAgendaItem {}", agendaItem);
        }
        InternalAgendaGroup ag = agendaItem.getAgendaGroup();
        ag.add(agendaItem);
    }
    if (agendaItem.getRule().isQuery()) {
        agenda.addQueryAgendaItem(agendaItem);
    } else if (agendaItem.getRule().isEager()) {
        agenda.addEagerRuleAgendaItem(agendaItem);
    }
}
Also used : InternalAgendaGroup(org.drools.core.common.InternalAgendaGroup) ActivationsFilter(org.drools.core.common.ActivationsFilter)

Example 7 with InternalAgendaGroup

use of org.drools.core.common.InternalAgendaGroup in project drools by kiegroup.

the class PathMemory method doUnlinkRule.

public void doUnlinkRule(InternalAgenda agenda) {
    TerminalNode rtn = ensureAgendaItemCreated(agenda);
    if (isLogTraceEnabled) {
        log.trace("    UnlinkRule name={}", rtn.getRule().getName());
    }
    agendaItem.getRuleExecutor().setDirty(true);
    if (!agendaItem.isQueued()) {
        if (isLogTraceEnabled) {
            log.trace("Queue RuleAgendaItem {}", agendaItem);
        }
        InternalAgendaGroup ag = agendaItem.getAgendaGroup();
        ag.add(agendaItem);
    }
}
Also used : InternalAgendaGroup(org.drools.core.common.InternalAgendaGroup)

Aggregations

InternalAgendaGroup (org.drools.core.common.InternalAgendaGroup)7 InternalWorkingMemory (org.drools.core.common.InternalWorkingMemory)3 DefaultKnowledgeHelper (org.drools.core.base.DefaultKnowledgeHelper)2 EventSupport (org.drools.core.common.EventSupport)2 RuleTerminalNodeLeftTuple (org.drools.core.reteoo.RuleTerminalNodeLeftTuple)2 PropagationContext (org.drools.core.spi.PropagationContext)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 ActivationsFilter (org.drools.core.common.ActivationsFilter)1 AgendaItem (org.drools.core.common.AgendaItem)1 InternalAgenda (org.drools.core.common.InternalAgenda)1 ProjectClassLoader (org.drools.core.common.ProjectClassLoader)1 InternalKnowledgeBase (org.drools.core.impl.InternalKnowledgeBase)1 KnowledgeBaseImpl (org.drools.core.impl.KnowledgeBaseImpl)1 RuleAgendaItem (org.drools.core.phreak.RuleAgendaItem)1 RuleExecutor (org.drools.core.phreak.RuleExecutor)1 ObjectTypeNode (org.drools.core.reteoo.ObjectTypeNode)1 RuleUnitDescr (org.drools.core.ruleunit.RuleUnitDescr)1