01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.core.service;
17:
18: import java.util.List;
19:
20: import org.kuali.core.document.Document;
21: import org.kuali.core.rule.BusinessRule;
22: import org.kuali.core.rule.event.KualiDocumentEvent;
23:
24: /**
25: * Defines the interface to the business-rule evaluation service, used to evauluate document-type-specific business rules using
26: * document-related events to drive the process.
27: */
28: public interface KualiRuleService {
29:
30: /**
31: * Retrieves and instantiates the businessRulesClass associated with the event's document type (if any), and calls the
32: * appropriate process* method of that businessRule for handling the given event type. This is a helper method that takes in the
33: * generic KualiDocumentEvent class and determines which event call to make.
34: *
35: * @param event
36: * @return true if no rule is applied, or all rules are applied successfully, false otherwise
37: */
38: public boolean applyRules(KualiDocumentEvent event);
39:
40: /**
41: * Builds a list containing ad hoc route person events appropriate for the context.
42: *
43: * @param document
44: * @return List
45: */
46: public List generateAdHocRoutePersonEvents(Document document);
47:
48: /**
49: * Builds a list containing ad hoc route workgroup events appropriate for the context.
50: *
51: * @param document
52: * @return List
53: */
54: public List generateAdHocRouteWorkgroupEvents(Document document);
55:
56: /**
57: * Allows code in actions or business objects to directly access rule methods in the class.
58: *
59: * @param document
60: * @param ruleInterface
61: * @return BusinessRule
62: */
63: public BusinessRule getBusinessRulesInstance(Document document,
64: Class ruleInterface);
65: }
|