1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.framework.engine;
17
18 import java.util.Map;
19
20 import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
21 import org.kuali.rice.krms.api.repository.agenda.AgendaDefinition;
22
23
24
25
26
27
28
29 public class BasicAgenda implements Agenda {
30
31 private Map<String, String> qualifiers;
32 private AgendaTree agendaTree;
33
34
35
36
37
38
39 public BasicAgenda(Map<String, String> qualifiers, AgendaTree agendaTree) {
40 this.qualifiers = qualifiers;
41 this.agendaTree = agendaTree;
42 }
43
44 @Override
45 public void execute(ExecutionEnvironment environment) {
46 agendaTree.execute(environment);
47 }
48
49 @Override
50 public boolean appliesTo(ExecutionEnvironment environment) {
51
52 for (Map.Entry<String, String> agendaQualifier : environment.getSelectionCriteria().getAgendaQualifiers().entrySet()) {
53 String agendaQualifierValue = qualifiers.get(agendaQualifier.getKey());
54 String environmentQualifierValue = agendaQualifier.getValue();
55 if (!environmentQualifierValue.equals(agendaQualifierValue)) {
56 return false;
57 }
58 }
59 return true;
60 }
61
62 }