RuleFlowGroup systemRuleFlowGroup = this.getRuleFlowGroup( ruleflowGroupName );
Match[] matches = ((InternalAgendaGroup)systemRuleFlowGroup).getActivations();
for ( Match match : matches ) {
Activation act = ( Activation ) match;
if ( act.isRuleAgendaItem() ) {
// The lazy RuleAgendaItem must be fully evaluated, to see if there is a rule match
RuleAgendaItem ruleAgendaItem = (RuleAgendaItem) act;
ruleAgendaItem.getRuleExecutor().evaluateNetwork(workingMemory);
LeftTupleList list = ruleAgendaItem.getRuleExecutor().getLeftTupleList();
for (RuleTerminalNodeLeftTuple lt = (RuleTerminalNodeLeftTuple) list.getFirst(); lt != null; lt = (RuleTerminalNodeLeftTuple) lt.getNext()) {
if ( ruleName.equals( lt.getRule().getName() ) ) {
if ( checkProcessInstance( lt, processInstanceId ) ) {
return true;
}
}
}
} else {
if ( ruleName.equals( act.getRule().getName() ) ) {
if ( checkProcessInstance( act, processInstanceId ) ) {
return true;
}
}
}