Coverage Report - org.kuali.rice.kns.service.KualiRuleService
 
Classes in this File Line Coverage Branch Coverage Complexity
KualiRuleService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kns.service;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import org.kuali.rice.kns.document.Document;
 21  
 import org.kuali.rice.kns.rule.BusinessRule;
 22  
 import org.kuali.rice.kns.rule.event.KualiDocumentEvent;
 23  
 
 24  
 
 25  
 /**
 26  
  * Defines the interface to the business-rule evaluation service, used to evauluate document-type-specific business rules using
 27  
  * document-related events to drive the process.
 28  
  */
 29  
 public interface KualiRuleService {
 30  
 
 31  
     /**
 32  
      * Retrieves and instantiates the businessRulesClass associated with the event's document type (if any), and calls the
 33  
      * appropriate process* method of that businessRule for handling the given event type. This is a helper method that takes in the
 34  
      * generic KualiDocumentEvent class and determines which event call to make.
 35  
      * 
 36  
      * @param event
 37  
      * @return true if no rule is applied, or all rules are applied successfully, false otherwise
 38  
      */
 39  
     public boolean applyRules(KualiDocumentEvent event);
 40  
 
 41  
     /**
 42  
      * Builds a list containing ad hoc route person events appropriate for the context.
 43  
      * 
 44  
      * @param document
 45  
      * @return List
 46  
      */
 47  
     public List generateAdHocRoutePersonEvents(Document document);
 48  
 
 49  
     /**
 50  
      * Builds a list containing ad hoc route workgroup events appropriate for the context.
 51  
      * 
 52  
      * @param document
 53  
      * @return List
 54  
      */
 55  
     public List generateAdHocRouteWorkgroupEvents(Document document);
 56  
 
 57  
     /**
 58  
      * Allows code in actions or business objects to directly access rule methods in the class.
 59  
      * 
 60  
      * @param document
 61  
      * @param ruleInterface
 62  
      * @return BusinessRule
 63  
      */
 64  
     public BusinessRule getBusinessRulesInstance(Document document, Class ruleInterface);
 65  
 }