[rules-users] Fusion, Insert Events with timestamp in the past.

SebastianStehle mail2stehle at gmail.com
Wed Jun 4 10:32:43 EDT 2014


We made another test with the pseudclock where we advanced the time after
each measurement.

Lets say we have the two measurements, the first at 10am and the second at
11am. Based on the rule before, you would expect that the rule fires at
10:10am because no other event is inserted. But what happens was that the
rule is activated at 11am, because the clock has not been advanced in the
meantime. This makes totally sense for me, so I thought you might need
another thread or so. 

If you implement it like this (pseudo-code), it works fine:

session.insert(first);
clock.advanceTime(first.getTime());

while (time < second.getTime()) {
    clock.advanceTime(100);
    time.add(100ms);
}

session.insert(second);
clock.advanceTime(second.getTime());

What makes our scenario very complicated is that we mix realtime and
pseudo-time a little bit. For example we have timers that trigger at
midnight or so (in realtime) and we have measurmenets with a delay of some
seconds, where we need a pseudoclock. I have no real idea how this can be
realized, but I still wonder, what @timestamp is for, if it cannot combined
with the normal clock.



--
View this message in context: http://drools.46999.n3.nabble.com/Fusion-Insert-Events-with-timestamp-in-the-past-tp4029843p4029858.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list