1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.patron.keyvalue;
17
18 import org.kuali.rice.core.api.util.ConcreteKeyValue;
19 import org.kuali.rice.core.api.util.KeyValue;
20 import org.kuali.rice.kew.api.identity.EmployeeId;
21 import org.kuali.rice.kim.impl.identity.affiliation.EntityAffiliationTypeBo;
22 import org.kuali.rice.kim.impl.identity.employment.EntityEmploymentStatusBo;
23 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24 import org.kuali.rice.krad.service.KRADServiceLocator;
25
26 import java.util.ArrayList;
27 import java.util.Collection;
28 import java.util.List;
29
30
31
32
33 public class OleEmployeeStatusKeyValues extends KeyValuesBase {
34
35
36
37
38
39
40 @Override
41 public List getKeyValues() {
42 List<KeyValue> keyValues = new ArrayList<KeyValue>();
43 Collection<EntityEmploymentStatusBo> employmentStatuses = KRADServiceLocator.getBusinessObjectService().findAll(EntityEmploymentStatusBo.class);
44 keyValues.add(new ConcreteKeyValue("", ""));
45 for (EntityEmploymentStatusBo employmentStatus : employmentStatuses) {
46 if(employmentStatus.isActive()) {
47 keyValues.add(new ConcreteKeyValue(employmentStatus.getCode(),employmentStatus.getName()));
48 }
49 }
50 return keyValues;
51 }
52 }
53