1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.service.impl;
17
18 import org.apache.struts.upload.FormFile;
19 import org.kuali.ole.select.businessobject.*;
20 import org.kuali.ole.select.constants.OleSelectPropertyConstants;
21 import org.kuali.ole.select.document.OlePurchaseOrderDocument;
22 import org.kuali.ole.select.document.OleRequisitionDocument;
23 import org.kuali.ole.select.service.BatchLoadService;
24 import org.kuali.ole.select.service.BibInfoService;
25 import org.kuali.ole.sys.OLEConstants;
26 import org.kuali.ole.sys.OLEKeyConstants;
27 import org.kuali.ole.sys.context.SpringContext;
28 import org.kuali.rice.core.api.config.property.ConfigurationService;
29 import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator;
30 import org.kuali.rice.coreservice.api.parameter.Parameter;
31 import org.kuali.rice.coreservice.api.parameter.ParameterKey;
32 import org.kuali.rice.kew.api.WorkflowDocument;
33 import org.kuali.rice.kim.api.identity.Person;
34 import org.kuali.rice.kim.api.identity.PersonService;
35 import org.kuali.rice.krad.service.BusinessObjectService;
36 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
37 import org.kuali.rice.krad.util.GlobalVariables;
38
39 import java.io.*;
40 import java.math.BigDecimal;
41 import java.util.*;
42
43
44 public class BatchLoadServiceImpl implements BatchLoadService {
45
46 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(BatchLoadServiceImpl.class);
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 @Override
73 public List<BibInfoBean> getBibInfoBeanList(String xmlString) {
74 List<BibInfoBean> bibInfoBeanList = new ArrayList<BibInfoBean>();
75 BuildVendorBibInfoBean buildVendorBibInfoBean = new BuildVendorBibInfoBean();
76 bibInfoBeanList = buildVendorBibInfoBean.getBibInfoList(xmlString);
77 return bibInfoBeanList;
78 }
79
80
81
82
83
84
85
86
87 @Override
88 public void saveFailureRecord(List<BibInfoBean> bibFailureRecordsList, Integer loadSumId, BigDecimal errorId) {
89 for (int i = 0; i < bibFailureRecordsList.size(); i++) {
90 BibInfoBean bibInfoBean = bibFailureRecordsList.get(i);
91 OleLoadFailureRecords oleLoadFailureRecords = new OleLoadFailureRecords();
92 oleLoadFailureRecords.setAcqLoadSumId(loadSumId);
93 oleLoadFailureRecords.setErrorId(errorId);
94 oleLoadFailureRecords.setIsbn(bibInfoBean.getIsbn());
95 oleLoadFailureRecords.setVendorId(bibInfoBean.getYbp());
96 oleLoadFailureRecords.setTitle(bibInfoBean.getTitle());
97 SpringContext.getBean(BusinessObjectService.class).save(oleLoadFailureRecords);
98 }
99 }
100
101
102
103
104
105
106
107
108 @Override
109 public void saveSuccessRecord(OleLoadSumRecords oleLoadSumRecords, int dupRecords, int poSucRecords, int sucRecords, String batchDiscription, BigDecimal batchLoadProfile, String fileName) {
110 if (LOG.isDebugEnabled()) {
111 LOG.debug("dupRecords =====================" + dupRecords);
112 LOG.debug("sucRecords =====================" + sucRecords);
113 LOG.debug("poSucRecords =====================" + poSucRecords);
114 }
115 oleLoadSumRecords.setAcqLoadDescription(batchDiscription);
116 oleLoadSumRecords.setProfileId(batchLoadProfile);
117 oleLoadSumRecords.setFileName(fileName);
118 oleLoadSumRecords.setAcqLoadFailCount(dupRecords);
119 oleLoadSumRecords.setAcqLoadSuccCount(sucRecords);
120 oleLoadSumRecords.setAcqLoadTotCount(dupRecords + sucRecords);
121 oleLoadSumRecords.setAcqLoadPoTotCount(poSucRecords);
122 oleLoadSumRecords.setPrincipalId(GlobalVariables.getUserSession().getPrincipalId());
123 SpringContext.getBean(BusinessObjectService.class).save(oleLoadSumRecords);
124
125 }
126
127
128
129
130
131
132
133 @Override
134 public boolean fileSizeValidation(Long fileSize) {
135 ConfigurationService kualiConfigurationService = SpringContext.getBean(ConfigurationService.class);
136
137 String maxFileSizeString = getParameter(OleSelectPropertyConstants.STAFF_UPLOAD_MAXFILESIZE);
138 Long maxFileSize = Long.parseLong(maxFileSizeString);
139
140 if (LOG.isDebugEnabled()) {
141 LOG.debug("defaultFileSize =====================" + maxFileSize);
142 LOG.debug("filesize =====================" + fileSize);
143
144 }
145
146 if (fileSize > maxFileSize && fileSize != 0) {
147 GlobalVariables.getMessageMap().putError(OLEConstants.GLOBAL_ERRORS, OLEKeyConstants.ERROR_BATCH_UPLOAD_FILE_SIZE, new Long(maxFileSize).toString() + "KB");
148 return true;
149 }
150
151 return false;
152 }
153
154
155
156
157
158
159
160
161 @Override
162 public List getDocIsbnList(List bibIsbnList) {
163 List docIsbnList = new ArrayList(0);
164 List<DocInfoBean> docInfoBeanList = new ArrayList<DocInfoBean>(0);
165 try {
166 BibInfoService bibInfoService = SpringContext.getBean(BibInfoServiceImpl.class);
167 docInfoBeanList = bibInfoService.getResult(bibIsbnList);
168 for (int j = 0; j < docInfoBeanList.size(); j++) {
169 if (docInfoBeanList.get(j).getIsbn_display() != null) {
170 docIsbnList.add(docInfoBeanList.get(j).getIsbn_display());
171 }
172 }
173 } catch (Exception ex) {
174 }
175
176 return docIsbnList;
177 }
178
179
180
181
182
183
184
185
186
187 @Override
188 public int getNoOfDupIsbnRecords(List testIsbnList, List bibIsbnList) {
189 HashSet temp = new HashSet();
190 temp.addAll(testIsbnList);
191 testIsbnList.clear();
192 testIsbnList.addAll(temp);
193 int dupRecords = 0;
194 for (int i = 0; i < testIsbnList.size(); i++) {
195 for (int j = 0; j < bibIsbnList.size(); j++) {
196 if (testIsbnList.get(i).equals(bibIsbnList.get(j))) {
197 dupRecords++;
198 }
199 }
200 }
201 if (LOG.isDebugEnabled()) {
202 LOG.debug("NO..OF duplicate records -------- > " + dupRecords);
203 }
204 return dupRecords;
205 }
206
207
208
209
210
211
212
213
214 @Override
215 public List<BibInfoBean> getIsbnFailureRecordsList(List isbnList, List<BibInfoBean> bibInfoBeanList) {
216 List<BibInfoBean> bibFailureRecordsList = new ArrayList<BibInfoBean>(0);
217 for (int i = 0; i < isbnList.size(); i++) {
218 for (int j = 0; j < bibInfoBeanList.size(); j++) {
219 String isbn = bibInfoBeanList.get(j).getIsbn();
220 if (isbn != null && !("".equals(isbn))) {
221 if (isbn.equals(isbnList.get(i).toString())) {
222 bibInfoBeanList.get(j).setFailure(bibInfoBeanList.get(j).getIsbn() + " is Duplicate ISBN value");
223 bibFailureRecordsList.add(bibInfoBeanList.get(j));
224 bibInfoBeanList.remove(j);
225 j--;
226 }
227 }
228 }
229 }
230
231 return bibFailureRecordsList;
232 }
233
234
235
236
237
238
239
240
241 @Override
242 public List<BibInfoBean> getVendorPoNumberFailureRecordsList(List vendorNumberList, List<BibInfoBean> bibInfoBeanList) {
243 List<BibInfoBean> bibFailureRecordsList = new ArrayList<BibInfoBean>(0);
244 for (int i = 0; i < vendorNumberList.size(); i++) {
245 for (int j = 0; j < bibInfoBeanList.size(); j++) {
246 String vendorPoValue = bibInfoBeanList.get(j).getYbp();
247 if (vendorPoValue.equals(vendorNumberList.get(i).toString())) {
248 bibInfoBeanList.get(j).setFailure(vendorPoValue + " is Duplicate Vendor Purchase Order value");
249 bibFailureRecordsList.add(bibInfoBeanList.get(j));
250 bibInfoBeanList.remove(j);
251 j--;
252 }
253 }
254 }
255
256 return bibFailureRecordsList;
257 }
258
259
260
261
262
263
264
265 @Override
266 public OleLoadSumRecords getOleLoadSumRecords(Map loadRecordsMap) {
267 OleLoadSumRecords oleLoadSumRecords = SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(OleLoadSumRecords.class, loadRecordsMap);
268
269 Map findProfileMap = new HashMap();
270 findProfileMap.put("profileId", oleLoadSumRecords.getProfileId());
271 OleLoadProfile oleLoadProfile = SpringContext.getBean(BusinessObjectService.class).findByPrimaryKey(OleLoadProfile.class, findProfileMap);
272
273 oleLoadSumRecords.setProfileFile(oleLoadProfile);
274
275 return oleLoadSumRecords;
276 }
277
278
279
280
281
282
283
284 @Override
285 public List<OleLoadFailureRecords> getOleFailureRecordsList(Map loadRecordsMap) {
286 Collection<OleLoadFailureRecords> oleLoadFailureRecordsList = SpringContext.getBean(BusinessObjectService.class).findMatching(OleLoadFailureRecords.class, loadRecordsMap);
287 for (OleLoadFailureRecords record : oleLoadFailureRecordsList) {
288 if (record.getErrorId().equals(new BigDecimal(5))) {
289 record.setError(OLEConstants.BATCH_ISBN_DUPLICATE_FOUND);
290 } else if (record.getErrorId().equals(new BigDecimal(1))) {
291 record.setError(OLEConstants.BATCH_VNO_DUPLICATE_FOUND);
292 } else if (record.getErrorId().equals(new BigDecimal(3))) {
293 record.setError(OLEConstants.BATCH_LOAD_FAILD_FOUND);
294 } else if (record.getErrorId().equals(new BigDecimal(6))) {
295 record.setError(OLEConstants.BATCH_VNO_NOT_FOUND);
296 } else if (record.getErrorId().equals(new BigDecimal(7))) {
297 record.setError(OLEConstants.BAD_BFN_NO_FOUND);
298 } else if (record.getErrorId().equals(new BigDecimal(8))) {
299 record.setError(OLEConstants.BAD_CONTROLL_LINE_FOUND);
300 } else if (record.getErrorId().equals(new BigDecimal(9))) {
301 record.setError(OLEConstants.APO_RULE_FAILED);
302 } else {
303 record.setError(OLEConstants.BATCH_TITLE_FAILD_FOUND);
304 }
305 }
306 return new ArrayList<OleLoadFailureRecords>(oleLoadFailureRecordsList);
307 }
308
309
310
311
312
313
314 @Override
315 public List getVendorPoNumberList(List<BibInfoBean> bibInfoBeanList) {
316 List bibVendorNumberList = new ArrayList(0);
317 for (int i = 0; i < bibInfoBeanList.size(); i++) {
318 bibVendorNumberList.add(bibInfoBeanList.get(i).getYbp());
319 }
320 List vendorNumberList = new ArrayList(0);
321
322 clearSystemCache();
323 Map map = new HashMap();
324 for (int i = 0; i < bibVendorNumberList.size(); i++) {
325 if (bibVendorNumberList.get(i) != null && !("".equals(bibVendorNumberList.get(i)))) {
326 map.put("vendorPoNumber", bibVendorNumberList.get(i));
327 }
328 int count = SpringContext.getBean(BusinessObjectService.class).countMatching(OleRequisitionDocument.class, map);
329 if (count != 0) {
330 vendorNumberList.add(bibVendorNumberList.get(i));
331 }
332 }
333
334
335
336
337
338
339
340
341 return vendorNumberList;
342 }
343
344
345
346
347
348
349 @Override
350 public List<BibInfoBean> getRequisitionFailureRecords(List reqList, List<BibInfoBean> bibInfoBeanList) {
351 List<BibInfoBean> reqFailureList = new ArrayList<BibInfoBean>(0);
352
353 for (int i = 0; i < reqList.size(); i++) {
354 if (reqList.get(i) == null) {
355 bibInfoBeanList.get(i).setFailure("Requisition Creation Load Error Problem");
356 reqFailureList.add(bibInfoBeanList.get(i));
357 bibInfoBeanList.remove(i);
358 i--;
359 }
360 }
361
362 return reqFailureList;
363 }
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393 @Override
394 public String getDestinationPath() {
395 ConfigurationService kualiConfigurationService = SpringContext.getBean(ConfigurationService.class);
396
397 String destinationPath = kualiConfigurationService.getPropertyValueAsString(OLEConstants.STAGING_DIRECTORY_KEY) + getParameter(OleSelectPropertyConstants.STAFF_UPLOAD_DESTINATIONPATH);
398 File dirCheck = (new File(destinationPath));
399 boolean isDir = dirCheck.exists();
400 if (LOG.isDebugEnabled()) {
401 LOG.debug("dirCheck =====================" + dirCheck);
402 }
403 if (!isDir) {
404 dirCheck.mkdir();
405 }
406 return destinationPath;
407 }
408
409 public Integer getPoCount(String reqIds) {
410 int count = 0;
411 List reqList = Arrays.asList(reqIds.split(","));
412 clearSystemCache();
413 Map map = new HashMap();
414
415 for (int i = 0; i < reqList.size(); i++) {
416 try {
417 map.put(OLEConstants.REQ_IDENTIFIER, reqList.get(i));
418
419
420
421
422
423
424
425
426
427
428 int poCount = SpringContext.getBean(BusinessObjectService.class).countMatching(
429 OlePurchaseOrderDocument.class, map);
430 if (poCount != 0) {
431 count++;
432 } else {
433 map.clear();
434 map.put(OLEConstants.PUR_DOC_IDENTIFIER, reqList.get(i));
435 Collection reqDocList = SpringContext.getBean(BusinessObjectService.class).findMatching(
436 OleRequisitionDocument.class, map);
437 if (0 < reqDocList.size()) {
438 OleRequisitionDocument req = ((List<OleRequisitionDocument>) reqDocList).get(0);
439 if (reqList.get(i).toString().equals(req.getPurapDocumentIdentifier().toString())) {
440 String status = getDocumentStatus(req.getDocumentNumber());
441 if (!OLEConstants.EXCEPTION.equals(status) && !OLEConstants.FINAL.equals(status)) {
442 return -1;
443 }
444 }
445
446 }
447 }
448 } catch (Exception e) {
449 LOG.error("Exception while processing PO Count ====" + e);
450 }
451 }
452 if (LOG.isDebugEnabled()) {
453 LOG.debug("NO..Of PO Created Count --- > " + count);
454 }
455 return count;
456 }
457
458 public void clearSystemCache() {
459
460 }
461
462 @Override
463 public void foundAllDuplicateRecords(List<BibInfoBean> bibInfoBeanList, List<BibInfoBean> reqFailureList, List<BibInfoBean> titleFailureList, List<BibInfoBean> isbnDupFailureList, List<BibInfoBean> vendorPoNumberDupFailureList, List bibIsbnList) {
464 for (int i = 0; i < bibInfoBeanList.size(); i++) {
465 if ("".equals(bibInfoBeanList.get(i).getAccountNumber()) || bibInfoBeanList.get(i).getAccountNumber() == null
466 || "".equals(bibInfoBeanList.get(i).getObjectCode()) || bibInfoBeanList.get(i).getObjectCode() == null) {
467 if (LOG.isDebugEnabled()) {
468 LOG.debug(" Account No ---------->>> " + bibInfoBeanList.get(i).getAccountNumber() + "\n Object code ------->> " + bibInfoBeanList.get(i).getObjectCode());
469 }
470 bibInfoBeanList.get(i).setFailure(OLEConstants.BATCH_LOAD_FAILD_FOUND);
471 reqFailureList.add(bibInfoBeanList.get(i));
472 bibInfoBeanList.remove(i);
473 i--;
474 } else if ("".equals(bibInfoBeanList.get(i).getTitle()) || bibInfoBeanList.get(i).getTitle() == null) {
475 bibInfoBeanList.get(i).setFailure(OLEConstants.BATCH_TITLE_FAILD_FOUND);
476 titleFailureList.add(bibInfoBeanList.get(i));
477 bibInfoBeanList.remove(i);
478 i--;
479 } else if ("".equals(bibInfoBeanList.get(i).getYbp()) || bibInfoBeanList.get(i).getYbp() == null) {
480 bibInfoBeanList.get(i).setFailure("Vendor Purchase Order value is Null");
481 vendorPoNumberDupFailureList.add(bibInfoBeanList.get(i));
482 bibInfoBeanList.remove(i);
483 i--;
484 } else {
485 if (bibIsbnList.contains(bibInfoBeanList.get(i).getIsbn())) {
486 bibInfoBeanList.get(i).setFailure(bibInfoBeanList.get(i).getIsbn() + " is Duplicate ISBN value");
487 isbnDupFailureList.add(bibInfoBeanList.get(i));
488 bibInfoBeanList.remove(i);
489 i--;
490 } else {
491 bibIsbnList.add(bibInfoBeanList.get(i).getIsbn());
492 }
493 }
494 }
495 }
496
497 @Override
498 public Long getFileSize(FormFile upLoadedFile) {
499 Long filesize = new Long(0);
500 if (!"".equals(upLoadedFile.getFileName())) {
501 String fileName = upLoadedFile.getFileName();
502 int fileExtensionCount = fileName.indexOf(".");
503 String extension = fileName.substring(fileExtensionCount + 1);
504 fileName = fileName.substring(0, fileExtensionCount);
505 filesize = new Long(upLoadedFile.getFileSize());
506 }
507
508 return filesize;
509 }
510
511 @Override
512 public int getDupRecordsCount(List<BibInfoBean> reqFailureList, List<BibInfoBean> titleFailureList, List<BibInfoBean> isbnDupFailureList, List<BibInfoBean> vendorPoNumberDupFailureList) {
513 int dupRecords = 0;
514 dupRecords += reqFailureList.size();
515 dupRecords += titleFailureList.size();
516 dupRecords += isbnDupFailureList.size();
517 dupRecords += vendorPoNumberDupFailureList.size();
518 return dupRecords;
519 }
520
521 @Override
522 public void saveAllFailureRecords(List<BibInfoBean> isbnFailureList, List<BibInfoBean> vendorPoNumberFailureList, List<BibInfoBean> reqFailureList, List<BibInfoBean> titleFailureList, List<BibInfoBean> vendorPoNumberDupFailureList, int acqLoadSumId) {
523 saveFailureRecord(isbnFailureList, acqLoadSumId, new BigDecimal(5));
524 saveFailureRecord(vendorPoNumberFailureList, acqLoadSumId, new BigDecimal(1));
525 saveFailureRecord(reqFailureList, acqLoadSumId, new BigDecimal(3));
526 saveFailureRecord(titleFailureList, acqLoadSumId, new BigDecimal(4));
527 saveFailureRecord(vendorPoNumberDupFailureList, acqLoadSumId, new BigDecimal(6));
528 }
529
530 @Override
531 public List<BibInfoBean> getBibFailureRecordsList(List<BibInfoBean> isbnFailureList, List<BibInfoBean> vendorPoNumberFailureList, List<BibInfoBean> reqFailureList, List<BibInfoBean> titleFailureList, List<BibInfoBean> vendorPoNumberDupFailureList) {
532 List<BibInfoBean> bibFailureRecordsList = new ArrayList<BibInfoBean>(0);
533
534 bibFailureRecordsList.addAll(isbnFailureList);
535
536 bibFailureRecordsList.addAll(vendorPoNumberFailureList);
537
538 bibFailureRecordsList.addAll(reqFailureList);
539
540
541 bibFailureRecordsList.addAll(titleFailureList);
542 bibFailureRecordsList.addAll(vendorPoNumberDupFailureList);
543 return bibFailureRecordsList;
544 }
545
546 @Override
547 public void createReqIdTextFile(List reqList, Integer acqSumId) {
548 try {
549 BufferedWriter out = new BufferedWriter(new FileWriter(getDestinationPath() + acqSumId + OLEConstants.BATCH_REQ_ID_FILE));
550 StringBuffer reqIds = new StringBuffer();
551 for (int i = 0; i < reqList.size(); i++) {
552 reqIds.append(reqList.get(i).toString() + ",");
553 }
554 out.write(reqIds.toString());
555 out.close();
556 } catch (Exception ex) {
557 }
558
559 }
560
561 @Override
562 public void createErrorMrkFile(String failureRawData, Integer acqSumId) {
563 try {
564 BufferedWriter out = new BufferedWriter(new FileWriter(getDestinationPath() + acqSumId + OLEConstants.BATCH_FAILURE_FILE_MRK));
565 out.write(failureRawData);
566 out.close();
567 } catch (Exception ex) {
568 }
569
570 }
571
572
573 @Override
574 public List getPOList(String loadSumId) {
575
576 String directoryPath = getDestinationPath() + loadSumId + OLEConstants.BATCH_REQ_ID_FILE;
577 File file = new File(directoryPath);
578 List poList = new ArrayList();
579 try {
580 if (file.exists()) {
581 InputStream fis = new FileInputStream(file);
582 BufferedInputStream bis = new BufferedInputStream(fis);
583 DataInputStream dis = new DataInputStream(bis);
584 String reqIds = dis.readLine();
585 List reqList = Arrays.asList(reqIds.split(","));
586 clearSystemCache();
587 Map map = new HashMap();
588 for (int i = 0; i < reqList.size(); i++) {
589 map.put("requisitionIdentifier", reqList.get(i));
590 Collection<OlePurchaseOrderDocument> olePurchaseOrderDocumentList = SpringContext.getBean(BusinessObjectService.class).findMatching(OlePurchaseOrderDocument.class, map);
591 if (!olePurchaseOrderDocumentList.isEmpty() && olePurchaseOrderDocumentList.iterator().next() != null) {
592 poList.add(olePurchaseOrderDocumentList.iterator().next().getDocumentNumber());
593 }
594 }
595 }
596 } catch (Exception ex) {
597 LOG.error("Exception while getting POList----> " + ex);
598 }
599 return poList;
600 }
601
602
603 @Override
604 public List getBibIDList(String loadSumId) {
605
606 String directoryPath = getDestinationPath() + loadSumId + OLEConstants.BATCH_REQ_ID_FILE;
607 File file = new File(directoryPath);
608 List bibIDList = new ArrayList();
609 try {
610 if (file.exists()) {
611 InputStream fis = new FileInputStream(file);
612 BufferedInputStream bis = new BufferedInputStream(fis);
613 DataInputStream dis = new DataInputStream(bis);
614 String reqIds = dis.readLine();
615 List reqList = Arrays.asList(reqIds.split(","));
616 clearSystemCache();
617 Map map = new HashMap();
618 for (int i = 0; i < reqList.size(); i++) {
619 map.put("purapDocumentIdentifier", reqList.get(i));
620 Collection<OleRequisitionDocument> oleRequisitionDocumentList = SpringContext.getBean(BusinessObjectService.class).findMatching(OleRequisitionDocument.class, map);
621 if (!oleRequisitionDocumentList.isEmpty() && oleRequisitionDocumentList.iterator().next() != null) {
622 List<OleRequisitionItem> oleRequisitionItemList = oleRequisitionDocumentList.iterator().next().getItems();
623 for (int j = 0; j < oleRequisitionItemList.size(); j++) {
624 OleRequisitionItem oleRequisitionItem = oleRequisitionItemList.get(j);
625 bibIDList.add(oleRequisitionItem.getItemTitleId());
626 }
627 }
628 }
629 }
630 } catch (Exception ex) {
631 LOG.error("Exception while getting BibIDList----> ", ex);
632 }
633 return bibIDList;
634 }
635
636 private String getDocumentStatus(String docNumber) {
637 try {
638 Person principalPerson = SpringContext.getBean(PersonService.class).getPerson(
639 GlobalVariables.getUserSession().getPerson().getPrincipalId());
640 WorkflowDocument workFlowDocument = KRADServiceLocatorWeb.getWorkflowDocumentService()
641 .loadWorkflowDocument(docNumber, principalPerson);
642 return workFlowDocument.getStatus().toString();
643 } catch (Exception e) {
644 LOG.error("Exception while getting document status---->" + e);
645 }
646 return null;
647 }
648
649 public String getParameter(String name){
650 ParameterKey parameterKey = ParameterKey.create(org.kuali.ole.OLEConstants.APPL_ID, org.kuali.ole.OLEConstants.SELECT_NMSPC, org.kuali.ole.OLEConstants.SELECT_CMPNT,name);
651 Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
652 return parameter!=null?parameter.getValue():null;
653 }
654 }