[rules-users] Setting date during execution of rules.
Scott Reed
sreed at avacoda.com
Wed Mar 5 10:09:56 EST 2008
As I understand it, the problem is that you have legacy code that uses
the system date in it's calculations and you cannot fix that so it will
take a date parameter, right? If so, then my recommendation is to fix
the legacy software if possible since messing with the system date gives
me the willies. If you can't fix it, then anything that can be called
from Java to set the system date (e.g.Runtime.exec(...).waitfor()?)
should be callable from the 'then' part of a rule. Make that call, call
your legacy code, then make the call to set the date back. But that is
so ugly, please don't tell anyone I had anything to do with it.
Nimesh Muley's message received 3/5/2008 1:25 AM:
>
> Hi,
>
>
>
> Is there a way to set the date while executing the rules? The
> effective dates would be checked against this date instead of today's
> date. By default the effective dates would be checked with System
> date. But in some cases we would need to execute the rules in a
> 'back-dated' mode.
>
>
>
> Use case.
>
> Let's say in insurance industry there are commission calculation rules
> for an agent. On these rules the effective dates are appropriate (as
> per their needs). Now when an agent is promoted and his/her promotion
> date is couple of months back then we would want to calculate the
> commission once again with the date as 2 months back.
>
>
>
> The nearest I could see is TimeMachine, as this is being used during
> execution of rules. Although I could not find a way to set the
> TimeMachine in release 4.0.4.
>
>
>
> Has anyone tried something like this before?
>
>
>
> Regards,
>
> - Nimesh
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
While so very true, this is not Murphy's Law, which I think of as
"Whatever can go wrong, probably will." (see
http://en.wikipedia.org/wiki/Murphy%27s_law)
Your rule here is called the 90-90 rule:
http://en.wikipedia.org/wiki/Ninety-ninety_rule
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080305/3d1298e4/attachment.html
More information about the rules-users
mailing list