[OPEN-ILS-DEV] Modifications to Circ Matrix Matchpoint checking
Thomas Berezansky
tsbere at mvlc.org
Fri Sep 3 15:13:36 EDT 2010
Theory:
Make the things returned (circulate, duration_rule,
recurring_fine_rule, max_fine_rule) "fall through" when set to NULL.
The attached patch attempts to make this happen on the back end, but
provides no front end interface changes for configuring it.
IT HAS NOT BEEN TESTED, mainly because I don't want to screw with our
test system right now when others may be trying to test existing
functionality.
It also adds in the ability to pass in one more (optional) boolean
parameter to the function to return the entire list of rules used to
create the final result, intended for "debug/test" front end
functionality to show what rules were considered in the fall-through
checking.
Pros:
You can override a subset of those fields with a specific rule while
allowing broader rules to fill in the holes.
This may result in less duplication of information across rules,
making things easier to maintain.
Thus, this may result in less rules in general, and thus less
processing time on sorting them overall.
Cons:
Manually figuring out the specifics of what will happen will take more
time/effort.
Changing a single rule may have a greater unintended effect on other rules.
Staff would need training for when to have a rule fall through and
when to set it.
More time to return from the DB for any rule that is "falling through"
to broader rules.
Examples for the following org tree:
CONS
-SYSA
--LIBC
--LIBD
-SYSB
--LIBE
--LIBF
Implementing the following "business" rules:
At the CONS level:
By default, everything circulates, uses DFLT_DUR duration, DFLT_RFINE
recurring fine, and DFLT_MFINE max fine.
Circ Modifier "book" uses the duration BOOK_DUR
Reference flagged materials don't circulate
At the SYSA level there are no special rules.
At the SYSB level the max fine should be SYSB_MFINE.
At the LIBC level the recurring fine is LIBC_RFINE
At the LIBD level circ modifier "book" uses the DFLT_DUR duration
instead of "BOOK_DUR"
At the LIBE level reference flagged materials circulate.
At the LIBF level there are no special rules.
The current method would require the following circ rules to implement
those business rules:
CIRC_LIB CIRC_MOD REFERENCE CIRC? DURATION_RULE RECURRING_FINE MAX_FINE
CONS NULL NULL TRUE DFLT_DUR DFLT_RFINE DFLT_MFINE
CONS NULL TRUE FALSE DFLT_DUR DFLT_RFINE DFLT_MFINE
CONS book NULL TRUE BOOK_DUR DFLT_RFINE DFLT_MFINE
CONS book TRUE FALSE BOOK_DUR DFLT_RFINE DFLT_MFINE
SYSB NULL NULL TRUE DFLT_DUR DFLT_RFINE SYSB_MFINE
SYSB NULL TRUE FALSE DFLT_DUR DFLT_RFINE SYSB_MFINE
SYSB book NULL TRUE BOOK_DUR DFLT_RFINE SYSB_MFINE
SYSB book TRUE FALSE BOOK_DUR DFLT_RFINE SYSB_MFINE
LIBC NULL NULL TRUE DFLT_DUR LIBC_RFINE DFLT_MFINE
LIBC NULL TRUE FALSE DFLT_DUR LIBC_RFINE DFLT_MFINE
LIBC book NULL TRUE BOOK_DUR LIBC_RFINE DFLT_MFINE
LIBC book TRUE FALSE BOOK_DUR LIBC_RFINE DFLT_MFINE
LIBD book NULL TRUE DFLT_DUR DFLT_RFINE DFLT_MFINE
LIBD book TRUE FALSE DFLT_DUR DFLT_RFINE DFLT_MFINE
LIBE NULL NULL TRUE DFLT_DUR DFLT_RFINE SYSB_MFINE
LIBE book NULL TRUE BOOK_DUR DFLT_RFINE SYSB_MFINE
16 circ rules total.
The new method would require the following circ rules to implement
those business rules:
CIRC_LIB CIRC_MOD REFERENCE CIRC? DURATION_RULE RECURRING_FINE MAX_FINE
CONS NULL NULL TRUE DFLT_DUR DFLT_RFINE DFLT_MFINE
CONS book NULL NULL BOOK_DUR NULL NULL
CONS NULL TRUE FALSE NULL NULL NULL
SYSB NULL NULL NULL NULL NULL SYSB_MFINE
LIBC NULL NULL NULL NULL LIBC_RFINE NULL
LIBD book NULL NULL DFLT_DUR NULL NULL
LIBE NULL TRUE TRUE NULL NULL NULL
7 circ rules total.
Starting with the above, lets assume that SYSA wants to change their
recurring fine to SYSA_RFINE.
LIBC's recurring fine is to be unchanged.
The current method requires the following changes:
ADD the following entries:
CIRC_LIB CIRC_MOD REFERENCE CIRC? DURATION_RULE RECURRING_FINE MAX_FINE
SYSA NULL NULL TRUE DFLT_DUR SYSA_RFINE DFLT_MFINE
SYSA NULL TRUE FALSE DFLT_DUR SYSA_RFINE DFLT_MFINE
SYSA book NULL TRUE BOOK_DUR SYSA_RFINE DFLT_MFINE
SYSA book TRUE FALSE BOOK_DUR SYSA_RFINE DFLT_MFINE
UPDATE the LIBD entries:
CIRC_LIB CIRC_MOD REFERENCE CIRC? DURATION_RULE RECURRING_FINE MAX_FINE
LIBD book NULL TRUE DFLT_DUR SYSA_RFINE DFLT_MFINE
LIBD book TRUE FALSE DFLT_DUR SYSA_RFINE DFLT_MFINE
4 rules added, 2 changed, total is now 20 rules.
The new method would require the following changes:
ADD the following entry:
CIRC_LIB CIRC_MOD REFERENCE CIRC? DURATION_RULE RECURRING_FINE MAX_FINE
SYSA NULL NULL NULL NULL SYSA_RFINE NULL
1 rule added, 0 changed, total is now 8 rules.
Thomas Berezansky
Merrimack Valley Library Consortium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: circ_matchpoint.patch
Type: text/x-patch
Size: 4824 bytes
Desc: not available
Url : http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20100903/912ba523/attachment.bin
-------------- next part --------------
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
More information about the Open-ils-dev
mailing list