1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.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.krms.util.KSKRMSExecutionConstants;
21
22 import java.util.Collections;
23 import java.util.Map;
24 import java.util.Set;
25
26
27 public class CompletedCourseTermResolver extends AbstractCourseTermResolver implements TermResolver<Boolean> {
28
29 @Override
30 public String getOutput() {
31 return KSKRMSExecutionConstants.COMPLETED_COURSES_TERM_NAME;
32 }
33
34 @Override
35 public Set<String> getParameterNames() {
36 return Collections.singleton(KSKRMSExecutionConstants.COURSE_CODE_TERM_PROPERTY);
37 }
38
39 @Override
40 public int getCost() {
41
42 return 1;
43 }
44
45 @Override
46 public Boolean resolve(Map<String, Object> resolvedPrereqs, Map<String, String> parameters) throws TermResolutionException {
47
48 TermResolver<Boolean> completedCoursesTermResolver = new CompletedCoursesTermResolver();
49
50 String courseCode = this.resolveCourseCode(parameters);
51
52 parameters.put(KSKRMSExecutionConstants.COURSE_CODE_TERM_PROPERTY, courseCode);
53 return completedCoursesTermResolver.resolve(resolvedPrereqs, parameters);
54 }
55 }