3
import com.poc.events.*;
declare InstigatorEvent
@role(event)
end
declare SomeOtherEvent
@role(event)
end
rule "Rule_1"
when
$instigator_1:InstigatorEvent(userId=="test_244903")
not(SomeOtherEvent(prop=="completedSomething",this after[0s,30s] $instigator_1))
then
System.out.println($instigator_1.getUserId());
end
rule "Rule_2"
when
$instigator_2:InstigatorEvent(userId=="test_244909")
not(SomeOtherEvent(prop=="completedSomething",this after[0s,20s] $instigator_2))
then
System.out.println($instigator_2.getUserId());
end

これは、小規模な POC で特定の機能を実装するために使用している DRL です。

これが私の質問です(私が核融合に慣れていないため、理解の欠如から生じた場合はご容赦ください)...

これを行うと、

InstigatorEvent event=new InstigatorEvent();
                    event.setUserId("test_244903");
                    session.insert(event);
InstigatorEvent event1=new InstigatorEvent();
                event1.setUserId("test_244909");
                session.insert(event1);
 session.fireAllRules();
 clock.advanceTime(21, TimeUnit.SECONDS);
 clock.advanceTime(20, TimeUnit.SECONDS);

私はこの出力を期待しています、

test_244903 
test_244909

しかし、私は、

test_244909

これは予想される動作ですか?私の理解は間違っていますか?誰かがここで正確に何が起こっているのか教えてもらえますか?

注: セッションは、「ストリーム」モード用に構成されたステートフル セッションです。クロックは SessionPseudoClock です。

4

0 に答える 0