Coverage Report - org.kuali.rice.krms.framework.engine.BasicAgenda
 
Classes in this File Line Coverage Branch Coverage Complexity
BasicAgenda
0%
0/16
0%
0/6
2.667
 
 1  
 package org.kuali.rice.krms.framework.engine;
 2  
 
 3  
 import java.util.Map;
 4  
 
 5  
 import org.kuali.rice.krms.api.Agenda;
 6  
 import org.kuali.rice.krms.api.ExecutionEnvironment;
 7  
 
 8  
 public class BasicAgenda implements Agenda {
 9  
 
 10  
         private String eventName;
 11  
         private Map<String, String> qualifiers;
 12  
         private AgendaTree agendaTree;
 13  
         
 14  0
         public BasicAgenda(String eventName, Map<String, String> qualifiers, AgendaTree agendaTree) {
 15  0
                 this.eventName = eventName;
 16  0
                 this.qualifiers = qualifiers;
 17  0
                 this.agendaTree = agendaTree;
 18  0
         }
 19  
         
 20  
         @Override
 21  
         public void execute(ExecutionEnvironment environment) {
 22  0
                 agendaTree.execute(environment);
 23  0
         }
 24  
 
 25  
         @Override
 26  
         public boolean appliesTo(ExecutionEnvironment environment) {
 27  0
                 if (eventName.equals(environment.getSelectionCriteria().getEventName())) {
 28  0
                         for (String agendaQualifierName : qualifiers.keySet()) {
 29  0
                                 String qualifierValue = qualifiers.get(agendaQualifierName);
 30  0
                                 String environmentQualifierValue = environment.getSelectionCriteria().getAgendaQualifiers().get(qualifierValue);
 31  0
                                 if (!qualifierValue.equals(environmentQualifierValue)) {
 32  0
                                         return false;
 33  
                                 }
 34  0
                         }
 35  
                 } else {
 36  0
                         return false;
 37  
                 }
 38  0
                 return true;
 39  
         }
 40  
 
 41  
 }