[rules-users] Fusion pseudo-time and custom timestamps

djb dbrownell83 at hotmail.com
Wed Jul 7 11:13:43 EDT 2010


Hi,

So I am making progress...  I am taking medical insurance claims and
inserting them into the entry-points as events, using the date of the claim
as the timestamp of the event.

I just want to check how am I meant to do this?  I decided I probably need a
pseudo-clock as I am using historical data.  I presume I am meant to work
out how long it has been since the last claim, and then call advanceTime, as
below...


long previousClaimTime = 0;
for (ClaimOrReversal cor : history)
{
   if (cor.isSubmittal())
      {
	long ms = cor.getTimestamp().getTime() - previousClaimTime;
	clock.advanceTime(ms, TimeUnit.MILLISECONDS);
	claimEntry.insert(cor);
      }

   previousClaimTime = cor.getTimestamp().getTime();
}


However, nothing is firing (claimEntry above corresponds to the entry point
name below).
Not even this:

rule claimReceived
when
      $event : ClaimSubmittedEvent() from entry-point
"ClaimReceivedEntryPoint"
then
      System.out.println("YEAH!");
end

What am I doing wrong?

Regards,
Daniel 
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Fusion-pseudo-time-and-custom-timestamps-tp949325p949325.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list