* Test auto-deactivation of RuleFlowGroup.
*/
@Test
public void testRuleFlowGroup4() {
ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
IdGenerator idGenerator = ruleBase.getReteooBuilder().getIdGenerator();
final InternalWorkingMemory workingMemory = (InternalWorkingMemory) ruleBase.newStatefulSession();;
final DefaultAgenda agenda = (DefaultAgenda) workingMemory.getAgenda();
// create rule0
final Consequence consequence0 = new Consequence() {
private static final long serialVersionUID = 510l;
public void evaluate(KnowledgeHelper knowledgeHelper,
WorkingMemory w) {
// do nothing
}
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
}
public void writeExternal(ObjectOutput out) throws IOException {
}
public String getName() {
return "default";
}
};
final Rule rule0 = new Rule( "test-rule0" );
rule0.setRuleFlowGroup( "rule-flow-group-0" );
rule0.setConsequence( consequence0 );
final RuleTerminalNode node0 = new RuleTerminalNode( idGenerator.getNextId(),
new MockTupleSource( idGenerator.getNextId() ),
rule0,
rule0.getLhs(),
0,
buildContext );