1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.validation.impl;
17
18 import org.kuali.ole.module.purap.businessobject.PurApAccountingLine;
19 import org.kuali.ole.sys.document.validation.impl.AccountingLineAccessibleValidation;
20 import org.kuali.rice.kew.api.WorkflowDocument;
21
22 import java.util.Set;
23
24
25
26
27 public class PurchasingAccountsPayableAccountingLineAccessibleValidation extends AccountingLineAccessibleValidation {
28
29
30
31
32
33
34
35 protected static Set<String> getCurrentRouteLevels(WorkflowDocument workflowDocument) {
36 Set<String> currentNodeNames = workflowDocument.getCurrentNodeNames();
37 return currentNodeNames;
38 }
39
40 @Override
41 protected String getGroupName() {
42 return "source";
43 }
44
45 @Override
46 protected String getAccountingLineCollectionProperty() {
47 return "items.sourceAccountingLines";
48 }
49
50
51
52
53 protected boolean needsDummyAccountIdentifier() {
54 if (((PurApAccountingLine) getAccountingLineForValidation()).getAccountIdentifier() != null) {
55 return false;
56 }
57
58 final WorkflowDocument workflowDocument = getAccountingDocumentForValidation().getDocumentHeader().getWorkflowDocument();
59 if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
60 return false;
61 }
62
63 return true;
64 }
65 }
66