Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Should
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Logic 0.5
-
Labels:None
-
Complexity:Undetermined
-
Development:
Description
We need an asOf operator that can trigger the creation of a new LogicContext within a new index date. It would take a single date as a parameter. Add to operators, LogicCriteria, and add processing in each DAO.
When evaluating a rule, one of the first steps before calling the rule's eval() method should be to check the logic criteria for an asOf() method – this will be facilitated by a convenience method like getAsOfDate(). If an asOf() date is set, then a new LogicContext should be constructed from the current LogicContext with the new asOf() date as its index date, and the rule's eval() called with this new context and the logic criteria without the asOf() operation.
All evals and reads that occur within the new LogicContext will, by default, use that context with its new index date as "today." Once the eval() has completed, subsequent processing will proceed with the original context, effectively "popping the altered index date off the stack."