001/**
002 * Copyright 2005-2018 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kns.rule.event;
017
018import org.apache.log4j.Logger;
019import org.kuali.rice.kns.rule.PromptBeforeValidation;
020import org.kuali.rice.krad.document.Document;
021import org.kuali.rice.krad.rules.rule.BusinessRule;
022import org.kuali.rice.krad.rules.rule.event.DocumentEventBase;
023
024/**
025 * Event for handling warnings/questions before rules are called.
026 * 
027 * @deprecated Only used in KNS classes, use KRAD.
028 */
029@Deprecated
030public class PromptBeforeValidationEvent extends DocumentEventBase {
031    private static final Logger LOG = Logger.getLogger(PromptBeforeValidationEvent.class);
032
033    boolean performQuestion;
034    String actionForwardName;
035    String questionId;
036    String questionText;
037    String questionType;
038    String questionCaller;
039    String questionContext;
040
041
042    /**
043     * @param description
044     * @param errorPathPrefix
045     * @param document
046     */
047    public PromptBeforeValidationEvent(String description, String errorPathPrefix, Document document) {
048
049        super(description, errorPathPrefix);
050        this.document = document;
051
052        LOG.debug(description);
053
054        performQuestion = false;
055    }
056
057
058    /**
059     * @return Returns the actionForwardName.
060     */
061    public String getActionForwardName() {
062        return actionForwardName;
063    }
064
065    /**
066     * @param actionForwardName The actionForwardName to set.
067     */
068    public void setActionForwardName(String actionForwardName) {
069        this.actionForwardName = actionForwardName;
070    }
071
072    /**
073     * @return Returns the performQuestion.
074     */
075    public boolean isPerformQuestion() {
076        return performQuestion;
077    }
078
079    /**
080     * @param performQuestion The performQuestion to set.
081     */
082    public void setPerformQuestion(boolean performQuestion) {
083        this.performQuestion = performQuestion;
084    }
085
086    /**
087     * @return Returns the questionCaller.
088     */
089    public String getQuestionCaller() {
090        return questionCaller;
091    }
092
093    /**
094     * @param questionCaller The questionCaller to set.
095     */
096    public void setQuestionCaller(String questionCaller) {
097        this.questionCaller = questionCaller;
098    }
099
100    /**
101     * @return Returns the questionContext.
102     */
103    public String getQuestionContext() {
104        return questionContext;
105    }
106
107    /**
108     * @param questionContext The questionContext to set.
109     */
110    public void setQuestionContext(String questionContext) {
111        this.questionContext = questionContext;
112    }
113
114    /**
115     * @return Returns the questionId.
116     */
117    public String getQuestionId() {
118        return questionId;
119    }
120
121    /**
122     * @param questionId The questionId to set.
123     */
124    public void setQuestionId(String questionId) {
125        this.questionId = questionId;
126    }
127
128    /**
129     * @return Returns the questionText.
130     */
131    public String getQuestionText() {
132        return questionText;
133    }
134
135    /**
136     * @param questionText The questionText to set.
137     */
138    public void setQuestionText(String questionText) {
139        this.questionText = questionText;
140    }
141
142    /**
143     * @return Returns the questionType.
144     */
145    public String getQuestionType() {
146        return questionType;
147    }
148
149    /**
150     * @param questionType The questionType to set.
151     */
152    public void setQuestionType(String questionType) {
153        this.questionType = questionType;
154    }
155
156    /**
157     * @see org.kuali.rice.krad.rules.rule.event.RuleEvent#getRuleInterfaceClass()
158     */
159    public Class<? extends BusinessRule> getRuleInterfaceClass() {
160        return PromptBeforeValidation.class;
161    }
162
163
164    /**
165     * @see org.kuali.rice.krad.rules.rule.event.RuleEvent#invokeRuleMethod(org.kuali.rice.krad.rules.rule.BusinessRule)
166     */
167    public boolean invokeRuleMethod(BusinessRule rule) {
168        return true;
169    }
170}