これが私のルールです:
rule "Your First Rule"
when
$testRule : TestRule(count >= 100)
then
System.out.println("100 PACKETS!");
end
これは、RuleBase と WorkingMemory を作成する方法です。
public void invokeRules(){
RuleBase ruleBase = readRule(); \\creates ruleBase from DRL package
workingMemory = ruleBase.newStatefulSession();
testRule = new TestRule();
factHandle = workingMemory.insert(testRule);
workingMemory.fireAllRules();
}
更新セクションがあります:
workingMemory.update(factHandle, testRule);
現在、WorkingMemory で 1 つの TestRule ファクトを取得しており、ルールは TestRule の別のインスタンスを作成しています。2 つの TestRule ファクトをインスタンス化していることは承知していますが、WorkingMemory のファクトのみが反応します。どこが間違っているのでしょうか?!
(ウィッツエンド)