View Javadoc

1   /**
2    * Copyright 2005-2012 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.krad.rules.rule.event;
17  
18  import org.kuali.rice.krad.document.Document;
19  import org.kuali.rice.krad.rules.rule.BusinessRule;
20  import org.kuali.rice.krad.rules.rule.DocumentAuditRule;
21  
22  /**
23   * Event class for document audit  
24   * 
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   *
27   */
28  public class DocumentAuditEvent extends KualiDocumentEventBase {
29      
30      /**
31       * Constructs a RunAuditEvent with the given errorPathPrefix and document.
32       * 
33       * @param errorPathPrefix
34       * @param document
35       * @param accountingLine
36       */
37      public DocumentAuditEvent(String errorPathPrefix, Document document) {
38          super("Running audit on " + KualiDocumentEventBase.getDocumentId(document), errorPathPrefix, document);
39      }
40  
41      /**
42       * Constructs a RunAuditEvent with the given document.
43       * 
44       * @param errorPathPrefix
45       * @param document
46       * @param accountingLine
47       */
48      public DocumentAuditEvent(Document document) {
49          this("", document);
50      }
51  
52      /**
53       * @see org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
54       */
55      public Class<? extends BusinessRule> getRuleInterfaceClass() {
56          return DocumentAuditRule.class;
57      }
58  
59      /**
60       * @see org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.krad.rules.rule.BusinessRule)
61       */
62      public boolean invokeRuleMethod(BusinessRule rule) {
63          return ((DocumentAuditRule) rule).processRunAuditBusinessRules(getDocument());
64      }
65  }
66