final StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();
final InternalAgenda agenda = (InternalAgenda) ksession.getAgenda();
// create rule1
final Consequence consequence1 = new Consequence() {
private static final long serialVersionUID = 510l;
public void evaluate(KnowledgeHelper knowledgeHelper,
WorkingMemory workingMemory) {
// do nothing
}
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
}
public void writeExternal(ObjectOutput out) throws IOException {
}
public String getName() {
return "default";
}
};
final RuleImpl rule1 = new RuleImpl("test-rule1");
rule1.setAgendaGroup("rule-flow-group-0");
rule1.setConsequence(consequence1);
final RuleTerminalNode node1 = new RuleTerminalNode(4,
new MockTupleSource(2),
rule1,
rule1.getLhs(),
0,
buildContext);
// create context
final PropagationContext context0 = pctxFactory.createPropagationContext(0,
PropagationContext.INSERTION,
rule1,
null,
new DefaultFactHandle());
final RuleTerminalNodeLeftTuple tuple1 = new RuleTerminalNodeLeftTuple(new DefaultFactHandle(1,
"cheese"),
node1,
true);
// create rule0
final Consequence consequence0 = new
Consequence() {
private static final long serialVersionUID = 510l;
public void evaluate(KnowledgeHelper knowledgeHelper,