1 /** 2 * Copyright 2004-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.student.contract.model.test.source; 17 18 import java.util.List; 19 20 import javax.jws.WebParam; 21 import javax.jws.WebService; 22 import javax.jws.soap.SOAPBinding; 23 24 25 /** 26 * Provides a read-only view of states and state flow information. 27 * 28 * This service needs to be implemented by any KS service that is going to handle states 29 * 30 * Version: 1.0 (Dev) 31 * 32 * @author kamal 33 */ 34 @WebService(name = "StateService", targetNamespace = "http://student.kuali.org/wsdl/state") 35 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) 36 public interface StateService { 37 38 39 /** 40 * 41 * This method retrieves the list of process keys associated with a type of object. 42 * 43 * @param typeKey Type key 44 * @param context Context information containing the principalId and locale information about the caller of service operation 45 * @return List of process keys 46 * @throws DoesNotExistException typeKey not found 47 * @throws InvalidParameterException invalid typeKey 48 * @throws MissingParameterException missing typeKey 49 * @throws OperationFailedException unable to complete request 50 */ 51 public List<String> getProcessKeys(@WebParam(name = "typeKey") String typeKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; 52 53 /** 54 * 55 * This method returns information about a state for a given process. State keys can be reused and state key along with process key uniquely identifies the state instance within a process. 56 * 57 * @param processKey Key identifying the process 58 * @param stateKey Key of the state 59 * @param context Context information containing the principalId and locale information about the caller of service operation 60 * @return Information about the state 61 * @throws DoesNotExistException processKey, stateKey not found 62 * @throws InvalidParameterException invalid processKey, stateKey 63 * @throws MissingParameterException missing processKey, stateKey 64 * @throws OperationFailedException unable to complete request 65 */ 66 public StateInfo getState(@WebParam(name = "processKey") String processKey, @WebParam(name = "stateKey") String stateKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; 67 68 /** 69 * This method returns a list of States that belong to a process. For e.g Clu states for clu proposal process 70 * 71 * @param processKey Key identifying the process 72 * @param context Context information containing the principalId and locale information about the caller of service operation 73 * @return List of StateInfo objects associated with the process 74 * @throws DoesNotExistException processKey not found 75 * @throws InvalidParameterException invalid processKey 76 * @throws MissingParameterException missing processKey 77 * @throws OperationFailedException unable to complete request 78 */ 79 public List<StateInfo> getStatesByProcess(@WebParam(name = "processKey") String processKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; 80 81 /** 82 * This method returns a list of StateInfo objects that are valid initial states for a given process. 83 * 84 * Often there will be just a single initial valid state. 85 * 86 * ? if more than one does the order matter? i.e. the 1st one returned should be the default but others still allowed? 87 * 88 * @param processKey Process key 89 * @param context Context information containing the principalId and locale information about the caller of service operation 90 * @return list of states are valid for the given process 91 * @throws DoesNotExistException processKey not found 92 * @throws InvalidParameterException invalid processKey 93 * @throws MissingParameterException missing processKey 94 * @throws OperationFailedException unable to complete request 95 */ 96 public List<StateInfo> getInitialValidStates(@WebParam(name = "processKey") String processKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; 97 98 99 /** 100 * 101 * This method retrieves the next happy state in a process given the current state. 102 * 103 * @param processKey Process key 104 * @param currentStateKey Current state key 105 * @param context Context information containing the principalId and locale information about the caller of service operation 106 * @return Next happy state in the process 107 * @throws DoesNotExistException processKey or currentStateKey not found 108 * @throws InvalidParameterException invalid processKey or currentStateKey 109 * @throws MissingParameterException missing processKey or currentStateKey 110 * @throws OperationFailedException unable to complete request 111 */ 112 public StateInfo getNextHappyState(@WebParam(name = "processKey") String processKey, @WebParam(name = "currentStateKey") String currentStateKey, @WebParam(name = "context") ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; 113 }