Comment 2 for bug 1822164

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

When I looked into this sort of thing a while back, I couldn't figure out how to create a custom filter expression that could join in other tables. It seems like you can only effect the where clause, which can only act on data in the event target table. So for overdues that would be the action.circulation data.

So if you wanted to target the circulation modifier you cannot, since that exists only in the asset.copy table.

But the checkout does contain the copy_location data. So if you wanted to limit to just one shelving location (with id 123) you could use something like.

{
"checkout.due" :
    { "context_org" : "circ_lib",
      "copy_location" : 123,
      "filter" :
            { "checkin_time" : null,
              "-or" :
                    [ { "stop_fines" : ["MAXFINES"] },
                      { "stop_fines" : null }
                    ]
            }
    }
}

If there is a way to add in joins I would love to see an example of that.

Otherwise I've used pre-processing sql scripts that go through all the events for a specific event definition and delete/cancel events that match/don't match extra criteria, such as circ_mod. And then run all the pending events after they have been cleaned up.

Josh