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