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 | |
public class BasicAgenda implements Agenda { |
24 | |
|
25 | |
private Map<String, String> qualifiers; |
26 | |
private AgendaTree agendaTree; |
27 | |
|
28 | 29 | public BasicAgenda(Map<String, String> qualifiers, AgendaTree agendaTree) { |
29 | 29 | this.qualifiers = qualifiers; |
30 | 29 | this.agendaTree = agendaTree; |
31 | 29 | } |
32 | |
|
33 | |
@Override |
34 | |
public void execute(ExecutionEnvironment environment) { |
35 | 29 | agendaTree.execute(environment); |
36 | 29 | } |
37 | |
|
38 | |
@Override |
39 | |
public boolean appliesTo(ExecutionEnvironment environment) { |
40 | 29 | for (String agendaQualifierName : qualifiers.keySet()) { |
41 | 29 | String qualifierValue = qualifiers.get(agendaQualifierName); |
42 | 29 | String environmentQualifierValue = environment.getSelectionCriteria().getAgendaQualifiers().get(agendaQualifierName); |
43 | 29 | if (!qualifierValue.equals(environmentQualifierValue)) { |
44 | 0 | return false; |
45 | |
} |
46 | 29 | } |
47 | 29 | return true; |
48 | |
} |
49 | |
|
50 | |
} |