1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.enrollment.class2.courseoffering.krms.termresolver;
17
18 import org.kuali.rice.krms.api.engine.TermResolutionException;
19 import org.kuali.rice.krms.api.engine.TermResolver;
20 import org.kuali.student.enrollment.academicrecord.service.AcademicRecordService;
21 import org.kuali.student.r2.common.dto.ContextInfo;
22 import org.kuali.student.r2.common.krms.util.KSKRMSExecutionUtil;
23 import org.kuali.student.r2.core.constants.KSKRMSServiceConstants;
24
25 import java.util.Collections;
26 import java.util.HashSet;
27 import java.util.Map;
28 import java.util.Set;
29
30
31
32
33
34
35
36
37 public class GPAForDurationTermResolver implements TermResolver<Float> {
38
39 private AcademicRecordService academicRecordService;
40
41 @Override
42 public Set<String> getPrerequisites() {
43 Set<String> prereqs = new HashSet<String>(2);
44 prereqs.add(KSKRMSServiceConstants.TERM_PREREQUISITE_PERSON_ID);
45 prereqs.add(KSKRMSServiceConstants.TERM_PREREQUISITE_CONTEXTINFO);
46 return Collections.unmodifiableSet(prereqs);
47 }
48
49 @Override
50 public String getOutput() {
51 return KSKRMSServiceConstants.TERM_RESOLVER_GPAFORDURATION;
52 }
53
54 @Override
55 public Set<String> getParameterNames() {
56 return Collections.emptySet();
57 }
58
59 @Override
60 public int getCost() {
61 return 5;
62 }
63
64 @Override
65 public Float resolve(Map<String, Object> resolvedPrereqs, Map<String, String> parameters) throws TermResolutionException {
66 ContextInfo context = (ContextInfo) resolvedPrereqs.get(KSKRMSServiceConstants.TERM_PREREQUISITE_CONTEXTINFO);
67 String personId = (String) resolvedPrereqs.get(KSKRMSServiceConstants.TERM_PREREQUISITE_PERSON_ID);
68
69
70 Float result = null;
71 try {
72
73
74 } catch (Exception e) {
75 KSKRMSExecutionUtil.convertExceptionsToTermResolutionException(parameters, e, this);
76 }
77
78 return result;
79 }
80
81 public AcademicRecordService getAcademicRecordService() {
82 return academicRecordService;
83 }
84
85 public void setAcademicRecordService(AcademicRecordService academicRecordService) {
86 this.academicRecordService = academicRecordService;
87 }
88 }