1 package org.kuali.ole.ingest.function;
2
3 import org.apache.log4j.Logger;
4 import org.kuali.ole.LoanUtil;
5 import org.kuali.ole.service.OleCirculationPolicyService;
6 import org.kuali.ole.service.OleCirculationPolicyServiceImpl;
7 import org.kuali.rice.krms.framework.engine.Function;
8
9 import java.util.ArrayList;
10 import java.util.List;
11
12
13
14
15
16
17
18
19 public class CheckDigitRoutine implements Function {
20
21 private static final Logger LOG = Logger.getLogger(CheckDigitRoutine.class);
22
23 @Override
24 public Object invoke(Object... arguments) {
25 LOG.info("-------- Inside CheckDigitRoutine -------------");
26 String pattern = "";
27 String itemBarcode = "";
28 if(arguments!=null && arguments.length==2){
29 pattern = (String)(arguments[0]);
30 itemBarcode = (String)(arguments[1]);
31 }
32 OleCirculationPolicyService oleCirculationPolicyService = new OleCirculationPolicyServiceImpl();
33 return oleCirculationPolicyService.isValidBarcode(itemBarcode,pattern);
34 }
35 }