1

I am trying to edit an existing Drools Fusion rule. The class we use for events does not have any kind of timestamp, so the rule is relying on the ones implicitly added by Drools at the time the events are created.

I would like to add some code to the "then" block of the rule to retrieve data from a database related to the times at which the events occurred. However, I can find no way to access these implicit timestamps.

Is there any way to do this, or am I going to have to re-define the event class?

Simon B
  • 232
  • 6
  • 14

1 Answers1

0

You can access the timestamp if you have the handler when you insert the event.

As far as I know, there is no way to access it in the rule. This old article from 2012 makes some good points about the complexity.

http://drools-moved.46999.n3.nabble.com/Drools-Fusion-Accessing-Events-time-read-only-with-Drools-in-STREAM-mode-REALTIME-clock-td4020251.html#a4020256

pjc
  • 240
  • 5
  • 14