"Failed to retrieve preview records" in client preview and "Duplicate declaration for variable" in jobd.log
- Product: Voyager
- Product Version: 8.0.0 and higher
- Relevant for Installation Type: Dedicated-Direct, Direct, Local, Total Care
Problem symptoms
Attempt to preview data change results in "Failed to retrieve preview records"
Data Change job with same parameters fails and logs error to jobd.log:
2016-06-28 11:31:31,282 41133825 [main] INFO com.exlibris.voyager.jobd.DataChangeJob - Error building knowledge base
com.exlibris.core.infra.common.exceptions.ParseDslException: Error 30208
java.lang.Throwable: Duplicate declaration for variable 'df{field}' in the rule '{rule name}' : [Rule name='{rule name}']
Duplicate declaration for variable 'sf{field and subfield}' in the rule '{rule name}' : [Rule name='{rule name}']
Cause
Data Change Rule Set has defined multiple conditions for same field/subfield to be applied simultaneously.
Resolution
Divide conditions for same field/subfield into separate rules, or select one condition to use in the rule.
Alternatively, review the "Linking Conditions" section of Chapter 3 in the GDC User's Guide. In some situations you may in fact be able to have multiple conditions in the same rule.
Additional Information
Example: Data Change Rule Set contains multiple conditions on 245 subfield a with logic like
when
MARC with subfield "245"."a" contains "cat"
MARC with subfield "245"."a" contains "cats"
then
replace string "cat" with string "dog"
replace string "cats" with string "dogs"
In this scenario, there are two definitions for the 245a variable, and Voyager cannot apply both simultaneously. To resolve this, create two separate rules (can still be within same Data Change Rule Set) with logic like
when
MARC with subfield "245"."a" contains "cat"
then
replace string "cat" with string "dog"
when
MARC with subfield "245"."a" contains "cats"
then
replace string "cats" with string "dogs"
- Article last edited: 04-Nov-2019