1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.core.class1.process.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.common.util.krms.RulesExecutionConstants; |
21 | |
|
22 | |
import java.util.Calendar; |
23 | |
import java.util.Collections; |
24 | |
import java.util.Date; |
25 | |
import java.util.Map; |
26 | |
import java.util.Set; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | 0 | public class CurrentDateResolver implements TermResolver<Date> { |
36 | |
|
37 | |
@Override |
38 | |
public Set<String> getPrerequisites() { |
39 | 0 | return Collections.emptySet(); |
40 | |
} |
41 | |
|
42 | |
@Override |
43 | |
public String getOutput() { |
44 | 0 | return RulesExecutionConstants.CURRENT_DATE_TERM_NAME; |
45 | |
} |
46 | |
|
47 | |
@Override |
48 | |
public Set<String> getParameterNames() { |
49 | 0 | return Collections.emptySet(); |
50 | |
} |
51 | |
|
52 | |
@Override |
53 | |
public int getCost() { |
54 | |
|
55 | 0 | return 0; |
56 | |
} |
57 | |
|
58 | |
@Override |
59 | |
public Date resolve(Map<String, Object> resolvedPrereqs, Map<String, String> parameters) throws TermResolutionException { |
60 | 0 | Calendar cal = Calendar.getInstance(); |
61 | |
|
62 | 0 | cal.set(2011, 11, 30); |
63 | |
|
64 | 0 | return cal.getTime(); |
65 | |
} |
66 | |
} |