001 /**
002 * Copyright 2005-2013 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 */
016 package org.kuali.rice.kew.framework.validation;
017
018 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
019 import org.kuali.rice.kew.api.KewApiConstants;
020 import org.kuali.rice.kew.api.validation.RuleValidationContext;
021 import org.kuali.rice.kew.api.validation.ValidationResults;
022 import org.kuali.rice.kew.framework.KewFrameworkServiceLocator;
023
024 import javax.jws.WebMethod;
025 import javax.jws.WebParam;
026 import javax.jws.WebResult;
027 import javax.jws.WebService;
028 import javax.jws.soap.SOAPBinding;
029 import javax.xml.bind.annotation.XmlElement;
030
031 /**
032 * Service responsible for exposing custom RuleValidationAttribute functionality.
033 * This service is exposed by the node hosting the specified custom attribute.
034 *
035 * @author Kuali Rice Team (rice.collab@kuali.org)
036 */
037 @WebService(name = KewFrameworkServiceLocator.RULE_VALIDATION_ATTRIBUTE_EXPORTER_SERVICE, targetNamespace = KewApiConstants.Namespaces.KEW_NAMESPACE_2_0)
038 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
039 public interface RuleValidationAttributeExporterService {
040 /**
041 * Validates the rule within the given RuleValidationContext.
042 *
043 * @return a ValidationResults object representing the results of the validation, if this is
044 * empty or <code>null</code> this signifies that validation was successful.
045 */
046 @WebMethod(operationName = "validate")
047 @WebResult(name = "validationResults")
048 @XmlElement(name = "validationResults", required = false)
049 ValidationResults validate(
050 @WebParam(name = "attributeName") String attributeName,
051 @WebParam(name = "validationContext") RuleValidationContext validationContext) throws RiceIllegalArgumentException;
052 }