Offline Transaction - Option to Skip Old Records

Bug #797409 reported by edoceo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Status tracked in Main
Main
Fix Released
Wishlist
Mike Rylander

Bug Description

When importing off-line transactions it may be desirable to skip checkin/checkout records that are older than the most recent information for the Asset in question. Would like the option, in off-line processing, to skip those transactions and/or add them to the exception queue for manual review.

My Envronment: Gentoo, PostgreSQL 9.0, OpenSRF 1.6.3, Evergreen 2.0.6 (& trunk)

Revision history for this message
edoceo (edoceo) wrote :

So far what I've done is to patch offline.pl script to check status_changed_time of the Asset (which I get via fetch_copy_by_barcode). I also added an option to offline-config.pl that enable/disable the "skip_late" option.

We're also, only checking the Asset status_changed_time, not the actual status.
These checks only apply on the Check-In / Check-Out options.
Also, for time parsing we had to add dependency on DateTime::Format::ISO8601 and the OpenSRF::Utils::cleanse_ISO8601 routine.

Changed in evergreen:
importance: Undecided → Wishlist
Revision history for this message
edoceo (edoceo) wrote :

This is a patch that offers that skippage - against the rel_2_0 branch, pretty straight-forward. Welcome feed-back, or method ideas how to implement the test case.

I did this:
--
git clone http://git.evergreen-ils.org/Evergreen.git
git checkout -b rel_2_0
git commit -as
git format-patch origin
--

Revision history for this message
Jason Etheridge (phasefx) wrote :

I'm going to try adding CKO/CKI time consideration and an org unit setting for this.

Revision history for this message
Jason Etheridge (phasefx) wrote :

Well, I was thinking last CKO/CKI time for last circ associated with the item, but status_changed_time should really be sufficient, right? One possible gotcha I see is the rollover from Reshelving to Available.

Revision history for this message
Jason Etheridge (phasefx) wrote :

Alright, I've signed off on edoceo's change and added my own enhancements in collab/phasefx/offline_date_checking @ working/Evergreen.git

HOWEVER

There are some issues I think should probably block this from being merged as is:

    1) the Reshelving -> Available rollover updates an item's Status Changed Time,
       and can thus trigger the exception during offline processing
    2) if an item is manipulated more than once in an offline session, then its
       Status Changed Time can be updated as the transactions are being processed,
       causing related transactions after the initial transaction to fail

Revision history for this message
Jason Etheridge (phasefx) wrote :

To address 2), which I'm not sure how often would happen in practice, we're thinking of keeping an in-memory hash of barcodes involved in offline transactions, and for any transaction where the barcode has already been seen, skip the item status changed test. I'm going to give this a go and re-push the branch.

Revision history for this message
Jason Etheridge (phasefx) wrote :

What do folks think of changing the status_changed_time trigger to ignore Reshelving -> Available changes?

Revision history for this message
Jason Etheridge (phasefx) wrote :

Well, the hash of barcodes notion needs to be tweaked slightly. If the first transaction in which a barcode appears actually results in a SKIP_ASSET_CHANGED event, then we want any subsequent transactions involving that barcode to fail as well. So I'll do two, one for has_seen and one for should_skip.

Revision history for this message
Jason Etheridge (phasefx) wrote :

Force-pushed a new collab/phasefx/offline_date_checking @ working/Evergreen.git

    Robusity SKIP_ASSET_CHANGE functionality

    by skipping status_changed_time test if a barcode has been encountered in prior
    offline transaction within a given session. Also return the SKIP_ASSET_CHANGE
    event for a given barcode if a prior test resulted in SKIP_ASSET_CHANGE

Revision history for this message
Mike Rylander (mrylander) wrote :

So, my $0.02: Reshelving and Available (and, actually, Reserves) are morally equivalent everywhere that counts (hold targetting, availability counting, etc), so I think we should adjust the trigger that sets status_change_time to ignore status changes between any of those three. I actually feel pretty strongly about that -- the branch offered here won't work in every circumstance without that change.

Revision history for this message
Jason Etheridge (phasefx) wrote :

I'll make it so and push another branch. Thanks Mike

Revision history for this message
Jason Etheridge (phasefx) wrote :

Force-pushed a new collab/phasefx/offline_date_checking with a new asset.acp_status_changed trigger which ignores status changes from Reshelving to Available.

tags: added: pullrequest
Revision history for this message
Mike Rylander (mrylander) wrote :

Merged to master. Solid work, folks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.