我正在尝试为需要检查在其他事情发生后的某个时间窗口内是否发生某些事情的事件编写规则。目前代码看起来像这样(它工作正常):
rule "Detect BPM reseed not starting when requested from Mart"
when
$martDailyRefreshRequestedEvent: MessageSentEvent(
$correlationId: correlationId,
$when: timestamp,
messageTypeName == "MartDailyRefreshCompletedEvent")
from entry-point "mart"
not ( MessageHandleStartedEvent(
this after[0ms, 30s] $martDailyRefreshRequestedEvent,
correlationId == $correlationId,
messageTypeName == "MartDailyRefreshCompletedEvent")
from entry-point "bpm")
then
notifier.notify("BPM not responding to MartDailyRefreshCompletedEvent quick enough",
String.format(
"At **%s** Mart sent out a **MartDailyRefreshCompletedEvent**.\n\n**BPM** was supposed to react to it within **30 seconds**.",
$when));
end
目前,它30s
被有效地硬编码。我读到如果你想参数化规则,你需要使用在 KB 中断言的其他事实,但我不知道如何为时间规则做这件事。
那么:如何30s
在此规则中“配置”,以便可以在应用程序之外更改值?像这样的东西:MessageHandleStartedEvent(this after [ $duration ] ...