The session clock is available from the StatefulKnowledgeSession:<br><br>   SessionClock clock = kSession.getSessionClock();<br>   long ctInMillis = clock.getCurrentTime();<br><br>Also, in RHS code, you can do<br><br>   kcontext.getKnowledgeRuntime().getSessionClock();<br>
<br>-W<br><br><br><br><br><div class="gmail_quote">On 6 May 2011 21:07, kkelleyjr <span dir="ltr">&lt;<a href="mailto:karl.kelley.jr@gmail.com">karl.kelley.jr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for the Reply,<br>
<br>
What you are saying makes sense... So, for my purpose of learning timers I<br>
would like to take a look at this further... The issues I am having is<br>
finding a reference to the real time session clock... So how can I get a<br>
reference to the session clock so that I can set time stamp properties<br>
within my facts...<br>
<br>
Also, I should point out that I am using the drools server so the<br>
configuration would be through spring in the knowledge-services.xml file...<br>
<br>
My thought is that I would set a global in my rules.drl file to the session<br>
clock instance... But I can not find the session clock for the real time<br>
session clock... Also, how would the spring configuration look...<br>
<br>
Use Case:<br>
<br>
Load some facts with a message in them, the last run time stamp is set to<br>
the current time, the next run time is set to some time in the future...<br>
<br>
Timer rule will check the current session time to the next run time and fire<br>
when appropriate...<br>
<br>
Then the facts last run time is updated as well as the next run time...<br>
<br>
Sounds simple... Just need to know how to get a ref to the session clock so<br>
I can do the checking and updating...<br>
<br>
Thanks for any advice...<br>
<br>
<br>
Any advice is welcome...<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rules-users-Firing-the-rule-at-the-basis-of-time-tp2889494p2909476.html" target="_blank">http://drools.46999.n3.nabble.com/rules-users-Firing-the-rule-at-the-basis-of-time-tp2889494p2909476.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>