Most likely the problem is that some of your classes (perhaps
com.ngc.dts.domain.common.PerDiemEntitlement) have mutable hash codes,
making them unsuitable for use as keys in a hash table (try using one
of these objects as a key in a HashMap, change the values of some
properties, then try to look up the same object; it will fail) and
some properties of these objects are being modified outside of a
(modify) call. This causes problems in Jess 6. Jess 7 works around
this by providing a function that lets you warn Jess about this issue
for a particular class.


I think erich.oliphant wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I am having a strange problem.  I am getting the following error (debug
> included).  The populate-last-travel-day rule fires based on the presence of
> facf-5 (among others).  The error is thrown in the rule body where I try to
> modify f-5.  I am not sure how the fact cannot be in working memory as the
> rule fired because of it's existence (and I'm not retracting it)  The body of
> the rule only modifies this fact and asserts a new one.  These rules are
> driven from Java code and verified that the supporting Java object still
> exists at the time the exception is thrown.
> 
> 
> rule
> --
> (defrule populate-last-travel-day-entitlement 
>       "first day at perdiem location entitlement" 
>     ?arrlocation <- (com.ngc.dts.domain.common.TripLocation 
>                               (arrivalTripItem ?ati) 
>                     (perDiemLocation ?x&:(eq ?x nil))) 
>     (test (neq (?ati getTravelDate) nil))
>     ?perdiemLocation <- (com.ngc.dts.domain.common.TripLocation 
>                                       (departureTripItem ?dti) 
>                       (perDiemLocation ?pdLocation&:(neq ?pdLocation nil)))
>     ?entitlement <- (com.ngc.dts.domain.common.PerDiemEntitlement (date
> ?pddate) ) 
>     ;;@todo investigate why same-day is not working as expected
>     ;;(test (neq (same-day (?dti getTravelDate) ?date) FALSE) ) 
>     (test (call org.apache.commons.lang.time.DateUtils isSameDay (?ati
> getTravelDate) ?pddate))
>     (test (call org.apache.commons.lang.time.DateUtils isSameDay (?dti
> getTravelDate) (?ati getTravelDate)))
>     (not (travel-day (date ?pddate)))
>     =>
>     ;; get the per 
>     (bind ?mie (ognl-get ?pdLocation
> "getEffectivePerDiemRate(#date).getMealsAndIncidentalsRate()" "date"
> (fact-slot-value ?entitlement date)))
>     (modify ?entitlement 
>         (perDiemLocation ?pdLocation)
>         (mealsAndIncidentalsAllowed (?mie multiply .75)))
>     (assert (travel-day (date ?pddate)))
>     )
> 
> --
> debug and error
> --
> 
> 
> MAIN::populate-first-travel-day-entitlement: +1+1+1+2+1+2+1+2+1+2+2+2+t
> MAIN::populate-last-travel-day-entitlement: =1=1=1+2=1+2=1+2+2+2=1+2+t
> MAIN::populate-full-perdiem-day-entitlements: =1=1+1+2+2=1+2+2+2+1+2+t
> MAIN::assign-cmr: =1+1+1=1+2+2+2+2+a+2+t
> MAIN::assign-pmr: =1=1=1=1=2+2+t
> MAIN::assert-entitlements: +1+1+t
> MAIN::assign-gmr: =1=1=1=1=2+2+2+2+t
> MAIN::zero-allowed-duty-conditions: =1+1+1+1+2+t
> MAIN::actual-lodging: =1=1=1=1+2+t
> MAIN::assert-entitlements: +1+1+t
>  ==> f-0 (MAIN::com.ngc.dts.domain.common.Trip (auth
> <Java-Object:com.ngc.dts.domain.common.Authorization>) (class
> <Java-Object:java.lang.Class>) (documentKey nil) (endDate nil) (endLocation
> nil) (id nil) (startDate nil) (startLocation nil) (taNumber nil)
> (travelOrderComments nil) (tripDescription nil) (tripDuration nil)
> (tripLocations <Java-Object:java.util.ArrayList>) (tripNumber 1) (tripProfile
> nil) (tripPurpose nil) (tripType nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.Trip>))
> ==> Activation: MAIN::assert-entitlements :  f-0
> FIRE 1 MAIN::assert-entitlements f-0
>  ==> f-1 (MAIN::com.ngc.dts.domain.common.PerDiemEntitlement
> (acutalLodgingCostLimit nil) (class <Java-Object:java.lang.Class>) (date
> <Java-Object:java.util.GregorianCalendar>) (dutyConditions
> <Java-Object:java.util.HashSet>) (leave nil) (lodgingAllowed nil)
> (lodgingExpense <Java-Object:com.ngc.dts.domain.common.Expense>)
> (mealsAndIncidentalsAllowed nil) (mealsAndIncidentalsExpense
> <Java-Object:com.ngc.dts.domain.common.Expense>) (otherEntitlementType nil)
> (perDiemLocation nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.PerDiemEntitlement>))
> ent date from code: 01/01/2006 12:00 PM
>  ==> f-2 (MAIN::com.ngc.dts.domain.common.PerDiemEntitlement
> (acutalLodgingCostLimit nil) (class <Java-Object:java.lang.Class>) (date
> <Java-Object:java.util.GregorianCalendar>) (dutyConditions
> <Java-Object:java.util.HashSet>) (leave nil) (lodgingAllowed nil)
> (lodgingExpense <Java-Object:com.ngc.dts.domain.common.Expense>)
> (mealsAndIncidentalsAllowed nil) (mealsAndIncidentalsExpense
> <Java-Object:com.ngc.dts.domain.common.Expense>) (otherEntitlementType nil)
> (perDiemLocation nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.PerDiemEntitlement>))
> ent date from code: 01/02/2006 12:00 PM
>  ==> f-3 (MAIN::com.ngc.dts.domain.common.PerDiemEntitlement
> (acutalLodgingCostLimit nil) (class <Java-Object:java.lang.Class>) (date
> <Java-Object:java.util.GregorianCalendar>) (dutyConditions
> <Java-Object:java.util.HashSet>) (leave nil) (lodgingAllowed nil)
> (lodgingExpense <Java-Object:com.ngc.dts.domain.common.Expense>)
> (mealsAndIncidentalsAllowed nil) (mealsAndIncidentalsExpense
> <Java-Object:com.ngc.dts.domain.common.Expense>) (otherEntitlementType nil)
> (perDiemLocation nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.PerDiemEntitlement>))
> ent date from code: 01/03/2006 12:00 PM
>  ==> f-4 (MAIN::com.ngc.dts.domain.common.PerDiemEntitlement
> (acutalLodgingCostLimit nil) (class <Java-Object:java.lang.Class>) (date
> <Java-Object:java.util.GregorianCalendar>) (dutyConditions
> <Java-Object:java.util.HashSet>) (leave nil) (lodgingAllowed nil)
> (lodgingExpense <Java-Object:com.ngc.dts.domain.common.Expense>)
> (mealsAndIncidentalsAllowed nil) (mealsAndIncidentalsExpense
> <Java-Object:com.ngc.dts.domain.common.Expense>) (otherEntitlementType nil)
> (perDiemLocation nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.PerDiemEntitlement>))
> ent date from code: 01/04/2006 12:00 PM
>  ==> f-5 (MAIN::com.ngc.dts.domain.common.PerDiemEntitlement
> (acutalLodgingCostLimit nil) (class <Java-Object:java.lang.Class>) (date
> <Java-Object:java.util.GregorianCalendar>) (dutyConditions
> <Java-Object:java.util.HashSet>) (leave nil) (lodgingAllowed nil)
> (lodgingExpense <Java-Object:com.ngc.dts.domain.common.Expense>)
> (mealsAndIncidentalsAllowed nil) (mealsAndIncidentalsExpense
> <Java-Object:com.ngc.dts.domain.common.Expense>) (otherEntitlementType nil)
> (perDiemLocation nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.PerDiemEntitlement>))
> ent date from code: 01/05/2006 12:00 PM
>  ==> f-6 (MAIN::com.ngc.dts.domain.common.TripLocation (arrivalTripItem
> <Java-Object:com.ngc.dts.domain.common.TripItem>) (class
> <Java-Object:java.lang.Class>) (departureTripItem
> <Java-Object:com.ngc.dts.domain.common.TripItem>) (endDate
> <Java-Object:java.util.GregorianCalendar>) (perDiemDays
> <Java-Object:java.util.Collections$EmptyList>) (perDiemLocation nil)
> (perDiemRates <Java-Object:java.util.Collections$EmptyList>) (startDate nil)
> (OBJECT <Java-Object:com.ngc.dts.domain.common.TripLocation>))
>  ==> f-7 (MAIN::com.ngc.dts.domain.common.TripLocation (arrivalTripItem
> <Java-Object:com.ngc.dts.domain.common.TripItem>) (class
> <Java-Object:java.lang.Class>) (departureTripItem
> <Java-Object:com.ngc.dts.domain.common.TripItem>) (endDate
> <Java-Object:java.util.GregorianCalendar>) (perDiemDays
> <Java-Object:java.util.ArrayList>) (perDiemLocation
> <Java-Object:com.ngc.dts.domain.common.PerDiemLocation>) (perDiemRates
> <Java-Object:java.util.ArrayList>) (startDate
> <Java-Object:java.util.GregorianCalendar>) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.TripLocation>))
> ==> Activation: MAIN::populate-first-travel-day-entitlement :  f-6,, f-7, 
> f-1,,,
> ==> Activation: MAIN::populate-full-perdiem-day-entitlements :  f-7,,, f-2,,,
> ==> Activation: MAIN::populate-full-perdiem-day-entitlements :  f-7,,, f-3,,,
> ==> Activation: MAIN::populate-full-perdiem-day-entitlements :  f-7,,, f-4,,,
>  ==> f-8 (MAIN::com.ngc.dts.domain.common.TripLocation (arrivalTripItem
> <Java-Object:com.ngc.dts.domain.common.TripItem>) (class
> <Java-Object:java.lang.Class>) (departureTripItem
> <Java-Object:com.ngc.dts.domain.common.TripItem>) (endDate nil) (perDiemDays
> <Java-Object:java.util.Collections$EmptyList>) (perDiemLocation nil)
> (perDiemRates <Java-Object:java.util.Collections$EmptyList>) (startDate
> <Java-Object:java.util.GregorianCalendar>) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.TripLocation>))
> ==> Activation: MAIN::populate-last-travel-day-entitlement :  f-8,, f-7, 
> f-5,,,
> FIRE 2 MAIN::populate-last-travel-day-entitlement f-8,, f-7, f-5,,,
> Jess reported an error in routine modify
>       while executing (modify ?entitlement (perDiemLocation ?pdLocation)
> (mealsAndIncidentalsAllowed (call ?mie multiply 0.75)))
>       while executing defrule MAIN::populate-last-travel-day-entitlement.
>   Message: Fact object not in working memory
> (MAIN::com.ngc.dts.domain.common.PerDiemEntitlement (acutalLodgingCostLimit
> nil) (class <Java-Object:java.lang.Class>) (date
> <Java-Object:java.util.GregorianCalendar>) (dutyConditions
> <Java-Object:java.util.HashSet>) (leave nil) (lodgingAllowed nil)
> (lodgingExpense <Java-Object:com.ngc.dts.domain.common.Expense>)
> (mealsAndIncidentalsAllowed nil) (mealsAndIncidentalsExpense
> <Java-Object:com.ngc.dts.domain.common.Expense>) (otherEntitlementType nil)
> (perDiemLocation nil) (OBJECT
> <Java-Object:com.ngc.dts.domain.common.PerDiemEntitlement>)).
>       at jess.an.a(Unknown Source)
> 
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> (use your own address!) List problems? Notify [EMAIL PROTECTED]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to