1 /** 2 * Copyright 2005-2013 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.krms.api.repository.function; 17 18 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; 19 import org.kuali.rice.krms.api.KrmsConstants; 20 21 import java.util.List; 22 23 import javax.jws.WebMethod; 24 import javax.jws.WebParam; 25 import javax.jws.WebResult; 26 import javax.jws.WebService; 27 import javax.jws.soap.SOAPBinding; 28 import javax.xml.bind.annotation.XmlElement; 29 import javax.xml.bind.annotation.XmlElementWrapper; 30 31 /** 32 * The function repository contains information about custom functions which 33 * can be used on propositions that are defined when constructing rules. 34 * 35 * @author Kuali Rice Team (rice.collab@kuali.org) 36 * 37 */ 38 @WebService(name = "functionRepositoryService", targetNamespace = KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0) 39 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) 40 public interface FunctionRepositoryService { 41 42 /** 43 * Retrieves the function for the given functionId. The function can be used when 44 * constructing propositions and defines the type of the parameters to the function 45 * as well as it's return type. 46 * 47 * @param functionId the id of the function to retrieve 48 * @return the function definition, or null if no function could be located for the given functionId 49 * 50 * @throws RiceIllegalArgumentException if the given functionId is null 51 */ 52 @WebMethod(operationName = "getFunction") 53 @WebResult(name = "function") 54 public FunctionDefinition getFunction(@WebParam(name = "functionId") String functionId) 55 throws RiceIllegalArgumentException; 56 57 /** 58 * Retrieves all of the functions for the given list of functionIds. The 59 * function can be used when constructing propositions and defines the type 60 * of the parameters to the function as well as it's return type. 61 * 62 * <p>The list which is returned from this operation may not be the same size as the list 63 * which is passed to this method. If a function doesn't exist for a given function id then 64 * no result for that id will be returned in the list. As a result of this, the returned 65 * list can be empty, but it will never be null. 66 * 67 * @param functionIds the list of function ids for which to retrieve the functions 68 * @return the list of functions for the given ids, this list will only contain functions for the ids 69 * that were resolved successfully, it will never return null but could return an empty list if no 70 * functions could be loaded for the given set of ids 71 * 72 * @throws RiceIllegalArgumentException if the given list of functionIds is null 73 */ 74 @WebMethod(operationName = "getFunctions") 75 @XmlElementWrapper(name = "functions", required = true) 76 @XmlElement(name = "function", required = false) 77 @WebResult(name = "functions") 78 public List<FunctionDefinition> getFunctions(@WebParam(name = "functionIds") List<String> functionIds) 79 throws RiceIllegalArgumentException; 80 81 }