001/**
002 * Copyright 2005-2016 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.kew.api.validation;
017
018import org.kuali.rice.kew.api.rule.RuleContract;
019import org.kuali.rice.kew.api.rule.RuleDelegationContract;
020
021/**
022 * The RuleValidationContext represents the context under which to validate a Rule which is being entered
023 * into the system, be it through the web-based Rule GUI or via an XML import.
024 *
025 * The ruleAuthor is the UserSession of the individual who is entering or editing the rule.  This may
026 * be <code>null</code> if the rule is being run through validation from the context of an XML rule
027 * import.
028 *
029 * The RuleDelegation represents the pointer to the rule from it's parent rule's RuleResponsibility.
030 * This will be <code>null</code> if the rule being entered is not a delegation rule.
031 *
032 * @author Kuali Rice Team (rice.collab@kuali.org)
033 */
034public interface RuleValidationContextContract {
035        /**
036         * Retrieve the rule which is being validated.
037         */
038        public RuleContract getRule();
039
040        /**
041         * Retrieve the principal of the rule author.  May be null in the
042         * case of an XML rule import.
043         */
044        public String getRuleAuthorPrincipalId();
045
046        /**
047         * Retrieve the RuleDelegation representing the parent of the rule being validated.  If the rule is
048         * not a delegation rule, then this will return null;
049         */
050        public RuleDelegationContract getRuleDelegation();
051}