View Javadoc

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;
17  
18  import org.kuali.rice.core.api.criteria.QueryByCriteria;
19  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
20  import org.kuali.rice.krms.api.KrmsConstants;
21  import org.kuali.rice.krms.api.repository.agenda.AgendaDefinition;
22  import org.kuali.rice.krms.api.repository.agenda.AgendaItemDefinition;
23  import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage;
24  import org.kuali.rice.krms.api.repository.proposition.PropositionDefinition;
25  import org.kuali.rice.krms.api.repository.reference.ReferenceObjectBinding;
26  import org.kuali.rice.krms.api.repository.rule.RuleDefinition;
27  import org.springframework.cache.annotation.Cacheable;
28  
29  import javax.jws.WebMethod;
30  import javax.jws.WebParam;
31  import javax.jws.WebResult;
32  import javax.jws.WebService;
33  import javax.jws.soap.SOAPBinding;
34  import javax.xml.bind.annotation.XmlElement;
35  import javax.xml.bind.annotation.XmlElementWrapper;
36  import java.util.List;
37  import java.util.Set;
38  import org.kuali.rice.krms.api.repository.action.ActionDefinition;
39  import org.kuali.rice.krms.api.repository.agenda.AgendaTreeDefinition;
40  import org.kuali.rice.krms.api.repository.context.ContextDefinition;
41  import org.kuali.rice.krms.api.repository.context.ContextSelectionCriteria;
42  import org.kuali.rice.krms.api.repository.language.NaturalLanguageTemplate;
43  
44  /**
45   * The rule maintenance service operations facilitate management of rules and
46   * associated information.
47   *
48   * @author Kuali Rice Team (rice.collab@kuali.org)
49   */
50  @WebService(name = "ruleManagementService", targetNamespace = KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0)
51  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
52  parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
53  public interface RuleManagementService extends TranslateBusinessMethods {
54  
55      /**
56       * Create RefObject-KRMS object binding
57       *
58       * @param referenceObjectDefinition  data for the new ReferenceObjectBinding to be created
59       * @return newly created ReferenceObjectBinding
60       * @throws RiceIllegalArgumentException if the given referenceObjectDefinition
61       *                                      is null or invalid
62       */
63      @WebMethod(operationName = "createReferenceObjectBinding")
64      @WebResult(name = "referenceObjectBinding")
65      public ReferenceObjectBinding createReferenceObjectBinding(@WebParam(
66              name = "referenceObjectDefinition") ReferenceObjectBinding referenceObjectDefinition) throws RiceIllegalArgumentException;
67  
68      /**
69       * Retrieve referenceObjectBinding  given a specific id
70       *
71       * @param id identifier of the ReferenceObjectBinding to be retrieved
72       * @return a ReferenceObjectBinding with the given id value
73       * @throws RiceIllegalArgumentException if the given  id is blank or
74       *                                      invalid
75       */
76      @WebMethod(operationName = "getReferenceObjectBinding")
77      @WebResult(name = "referenceObjectBinding")
78      public ReferenceObjectBinding getReferenceObjectBinding(@WebParam(
79              name = "id") String id) throws RiceIllegalArgumentException;
80  
81      /**
82       * Retrieve list of ReferenceObjectBinding objects given ids
83       *
84       * @param ids identifiers of the ReferenceObjectBinding to be retrieved
85       * @return list of ReferenceObjectBinding objects for the given ids
86       * @throws RiceIllegalArgumentException if one or more ids in the give list
87       *                                      is blank or invalid
88       */
89      @WebMethod(operationName = "getReferenceObjectBindings")
90      @XmlElementWrapper(name = "referenceObjectBindings", required = true)
91      @XmlElement(name = "referenceObjectBinding", required = false)
92      @WebResult(name = "referenceObjectBindings")
93      List<ReferenceObjectBinding> getReferenceObjectBindings(@WebParam(
94              name = "ids") List<String> ids) throws RiceIllegalArgumentException;
95  
96      /**
97       * Retrieves list of ReferenceObjectBinding objects for the given ref obj
98       * discriminator type
99       *
100      * @param referenceObjectReferenceDiscriminatorType  reference object type
101      * @return list of ReferenceObjectBinding objects for the given discriminator
102      *         type
103      * @throws RiceIllegalArgumentException if the given  referenceObjectReferenceDiscriminatorType is
104      *                                      blank or invalid
105      */
106     @WebMethod(operationName = "findReferenceObjectBindingsByReferenceDiscriminatorType")
107     @XmlElementWrapper(name = "referenceObjectBindings", required = true)
108     @XmlElement(name = "referenceObjectBinding", required = false)
109     @WebResult(name = "referenceObjectBindings")
110     public List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceDiscriminatorType(
111             @WebParam(name = "referenceObjectReferenceDiscriminatorType") String referenceObjectReferenceDiscriminatorType) throws RiceIllegalArgumentException;
112 
113     /**
114      * Retrieves list of ReferenceObjectBinding objects for the given krms obj
115      * discriminator type
116      *
117      * @param referenceObjectKrmsDiscriminatorType  reference object type
118      * @return list of ReferenceObjectBinding objects for the given discriminator
119      *         type
120      * @throws RiceIllegalArgumentException if the given  referenceObjectKrmsDiscriminatorType is
121      *                                      blank or invalid
122      */
123     @WebMethod(operationName = "findReferenceObjectBindingsByKrmsDiscriminatorType")
124     @XmlElementWrapper(name = "referenceObjectBindings", required = true)
125     @XmlElement(name = "referenceObjectBinding", required = false)
126     @WebResult(name = "referenceObjectBindings")
127     public List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsDiscriminatorType(
128             @WebParam(name = "referenceObjectKrmsDiscriminatorType") String referenceObjectKrmsDiscriminatorType) throws RiceIllegalArgumentException;
129 
130     
131     /**
132      * Retrieves list of ReferenceObjectBinding objects for the given obj
133      * discriminator type and reference object id
134      *
135      * @param referenceObjectReferenceDiscriminatorType  reference object type
136      * @param referenceObjectId reference object id
137      * @return list of ReferenceObjectBinding objects for the given discriminator
138      *         type
139      * @throws RiceIllegalArgumentException if the given  referenceObjectKrmsDiscriminatorType or id is
140      *                                      blank or invalid
141      */
142     @WebMethod(operationName = "findReferenceObjectBindingsByReferenceObject")
143     @XmlElementWrapper(name = "referenceObjectBindings", required = true)
144     @XmlElement(name = "referenceObjectBinding", required = false)
145     @WebResult(name = "referenceObjectBindings")
146     public List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceObject (
147             @WebParam(name = "referenceObjectReferenceDiscriminatorType") String referenceObjectReferenceDiscriminatorType, 
148             @WebParam(name = "referenceObjectId") String referenceObjectId) 
149             throws RiceIllegalArgumentException;
150     
151     /**
152      * Retrieves list of ReferenceObjectBinding objects for the given KRMS obj
153      * id.
154      *
155      * @param krmsObjectId identifier of the KRMS obj
156      * @return list of ReferenceObjectBinding objects for the given KRMS obj
157      * @throws RiceIllegalArgumentException if the given krmsObjectId is blank or
158      *                                      invalid
159      */
160     @WebMethod(operationName = "findReferenceObjectBindingsByKrmsObjectId")
161     @XmlElementWrapper(name = "referenceObjectBindings", required = true)
162     @XmlElement(name = "referenceObjectBinding", required = false)
163     @WebResult(name = "referenceObjectBindings")
164     public List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsObject(
165             @WebParam(name = "krmsObjectId") String krmsObjectId) throws RiceIllegalArgumentException;
166 
167     /**
168      * Update the ReferenceObjectBinding object specified by the identifier in the
169      * given DTO
170      *
171      * @param referenceObjectBindingDefinition DTO with updated info and id of the object to be updated
172      * @throws RiceIllegalArgumentException if the given  referenceObjectBindingDefinition
173      *                                      is null or invalid
174      */
175     @WebMethod(operationName = "updateReferenceObjectBinding")
176     public void updateReferenceObjectBinding(ReferenceObjectBinding referenceObjectBindingDefinition) throws RiceIllegalArgumentException;
177 
178     /**
179      * Delete the specified ReferenceObjectBinding object
180      *
181      * @param id identifier of the object to be deleted
182      * @throws RiceIllegalArgumentException if the given  id is null or invalid
183      */
184     @WebMethod(operationName = "deleteReferenceObjectBinding")
185     public void deleteReferenceObjectBinding(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
186 
187 
188     /**
189      * Query for ReferenceObjectBinding ids based on the given search criteria
190      * which is a Map of ReferenceObjectBinding field names to values. <p/> <p>
191      * This method returns it's results as a List of ReferenceObjectBinding ids
192      * that match the given search criteria. </p>
193      *
194      * @param queryByCriteria the criteria.  Cannot be null.
195      * @return a list of ids matching the given criteria properties.  An empty
196      *         list is returned if an invalid or non-existent criteria is
197      *         supplied.
198      * @throws RiceIllegalArgumentException if the queryByCriteria is null
199      */
200     @WebMethod(operationName = "findReferenceObjectBindingIds")
201     @XmlElementWrapper(name = "referenceObjectBindingIds", required = true)
202     @XmlElement(name = "referenceObjectBindingId", required = false)
203     @WebResult(name = "referenceObjectBindingIds")
204     List<String> findReferenceObjectBindingIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
205 
206     ////
207     //// agenda methods
208     ////
209     /**
210      * Create Agenda and an empty first item
211      *
212      * @param agendaDefinition data for the new Agenda to be created
213      * @return newly created Agenda
214      * @throws RiceIllegalArgumentException if the given agendaDefinition is
215      *                                      null or invalid
216      */
217     @WebMethod(operationName = "createAgenda")
218     @WebResult(name = "agenda")
219     public AgendaDefinition createAgenda(@WebParam(name = "AgendaDefinition") AgendaDefinition agendaDefinition) throws RiceIllegalArgumentException;
220 
221     /**
222      * Create Agenda if not found by contextId and name
223      *
224      * @param agendaDefinition data for the new Agenda to be created
225      * @return newly created or found Agenda
226      * @throws RiceIllegalArgumentException if the given agendaDefinition is
227      *                                      null or invalid
228      */
229     @WebMethod(operationName = "findCreateAgenda")
230     @WebResult(name = "agenda")
231     public AgendaDefinition findCreateAgenda(@WebParam(name = "AgendaDefinition") AgendaDefinition agendaDefinition) throws RiceIllegalArgumentException;
232 
233     /**
234      * Retrieve Agenda for the specified id
235      *
236      * @param id identifier for the Agenda
237      * @return specified Agenda
238      * @throws RiceIllegalArgumentException if the given id is null or invalid
239      */
240     @WebMethod(operationName = "getAgenda")
241     @WebResult(name = "agenda")
242     public AgendaDefinition getAgenda(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
243 
244     /**
245      * Retrieves an Agenda from the repository based on the provided agenda name
246      * and context id.
247      *
248      * @param name the name of the Agenda to retrieve.
249      * @param contextId the id of the context that the agenda belongs to.
250      * @return an {@link AgendaDefinition} identified by the given name and namespace.  
251      * A null reference is returned if an invalid or non-existent name and
252      * namespace combination is supplied.
253      */
254     @WebMethod(operationName = "getAgendaByNameAndContextId")
255     @WebResult(name = "agenda")
256     public AgendaDefinition getAgendaByNameAndContextId (@WebParam(name = "name") String name,
257                                                          @WebParam(name = "contextId") String contextId);
258     
259     /**
260      * Retrieve Agendas of the specified type
261      *
262      * @param typeId type of the Agenda
263      * @return list of Agendas of the specified type
264      * @throws RiceIllegalArgumentException if the given typeId is null or
265      *                                      invalid
266      */
267     @WebMethod(operationName = "getAgendasByType")
268     @XmlElementWrapper(name = "agendas", required = true)
269     @XmlElement(name = "agenda", required = false)
270     @WebResult(name = "agendas")
271     public List<AgendaDefinition> getAgendasByType(@WebParam(name = "typeId") String typeId) throws RiceIllegalArgumentException;
272 
273     /**
274      * Retrieve Agendas associated with the specified context
275      *
276      * @param contextId  context of interest
277      * @return list of Agendas associated with the context
278      * @throws RiceIllegalArgumentException if the given contextId is null or
279      *                                      invalid
280      */
281     @WebMethod(operationName = "getAgendasByContext")
282     @XmlElementWrapper(name = "agendas", required = true)
283     @XmlElement(name = "agenda", required = false)
284     @WebResult(name = "agendas")
285     public List<AgendaDefinition> getAgendasByContext(@WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
286 
287     /**
288      * Retrieve Agendas of the specified type and context
289      *
290      * @param typeId  type of the Agenda
291      * @param contextId  context of interest
292      * @return list of Agendas associated with the specified type and context
293      * @throws RiceIllegalArgumentException if the given typeId or contextId
294      *                                      null or invalid
295      */
296     @WebMethod(operationName = "getAgendasByTypeAndContext")
297     @XmlElementWrapper(name = "agendas", required = true)
298     @XmlElement(name = "agenda", required = false)
299     @WebResult(name = "agendas")
300     public List<AgendaDefinition> getAgendasByTypeAndContext(@WebParam(name = "typeId") String typeId,
301             @WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
302 
303     /**
304      * Update the Agenda specified by the identifier in the input DTO
305      *
306      * @param agendaDefinition DTO with updated info and identifier of the object to be updated
307      * @throws RiceIllegalArgumentException if the given agendaDefinition is
308      *                                      null or invalid
309      */
310     @WebMethod(operationName = "updateAgenda")
311     public void updateAgenda(@WebParam(name = "agendaDefinition") AgendaDefinition agendaDefinition) throws RiceIllegalArgumentException;
312 
313     /**
314      * Delete the specified Agenda
315      *
316      * @param id identifier of the object to be deleted
317      * @throws RiceIllegalArgumentException if the given id is null or invalid
318      */
319     @WebMethod(operationName = "deleteAgenda")
320     public void deleteAgenda(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
321 
322     ////
323     //// agenda item methods
324     ////
325     /**
326      * Create AgendaItem
327      *
328      * @param agendaItemDefinition  data for the new AgendaItem to be created
329      * @return newly created AgendaItem
330      * @throws RiceIllegalArgumentException if the given agendaItemDefinition is
331      *                                      null or invalid
332      */
333     @WebMethod(operationName = "createAgendaItem")
334     @WebResult(name = "agendaItem")
335     public AgendaItemDefinition createAgendaItem(@WebParam(name = "AgendaItemDefinition") AgendaItemDefinition agendaItemDefinition) throws RiceIllegalArgumentException;
336 
337     /**
338      * Retrieve AgendaItem by the specified identifier
339      *
340      * @param id identifier of the AgendaItem
341      * @return AgendaItem specified by the identifier
342      * @throws RiceIllegalArgumentException if the given id is null or invalid
343      */
344     @WebMethod(operationName = "getAgendaItem")
345     @WebResult(name = "agendaItem")
346     public AgendaItemDefinition getAgendaItem(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
347 
348     /**
349      * Retrieve AgendaItems by specified type
350      *
351      * @param typeId type of the AgendaItems
352      * @return list of AgendaItems of the specified type
353      * @throws RiceIllegalArgumentException if the given typeId is null or
354      *                                      invalid
355      */
356     @WebMethod(operationName = "getAgendaItemsByType")
357     @XmlElementWrapper(name = "agendaItems", required = true)
358     @XmlElement(name = "agendaItem", required = false)
359     @WebResult(name = "agendaItems")
360     public List<AgendaItemDefinition> getAgendaItemsByType(@WebParam(name = "typeId") String typeId) throws RiceIllegalArgumentException;
361 
362     /**
363      * Retrieve AgendaItems associated with a context
364      *
365      * @param contextId context identifier
366      * @return list of AgendaItems associated with a context
367      * @throws RiceIllegalArgumentException if the given  contextId is null or
368      *                                      invalid
369      */
370     @WebMethod(operationName = "getAgendaItemsByContext")
371     @XmlElementWrapper(name = "agendaItems", required = true)
372     @XmlElement(name = "agendaItem", required = false)
373     @WebResult(name = "agendaItems")
374     public List<AgendaItemDefinition> getAgendaItemsByContext(@WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
375 
376     /**
377      * Retrieve AgendaItems by type and context
378      *
379      * @param typeId type of the Agendas
380      * @param contextId context with which the Agendas are associated
381      * @return list of AgendaItems of the specified type and context
382      * @throws RiceIllegalArgumentException if the given  typeId or contextId
383      *                                      null or invalid
384      */
385     @WebMethod(operationName = "getAgendaItemsByTypeAndContext")
386     @XmlElementWrapper(name = "agendaItems", required = true)
387     @XmlElement(name = "agendaItem", required = false)
388     @WebResult(name = "agendaItems")
389     public List<AgendaItemDefinition> getAgendaItemsByTypeAndContext(@WebParam(name = "typeId") String typeId,
390             @WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
391 
392     /**
393      * Update an AgendaItem
394      *
395      * @param agendaItemDefinition  updated data for the AgendaItem, with id of the object to be updated
396      * @throws RiceIllegalArgumentException if the given  agendaItemDefinition
397      *                                      is null or invalid
398      */
399     @WebMethod(operationName = "updateAgendaItem")
400     public void updateAgendaItem(@WebParam(name = "agendaItemDefinition") AgendaItemDefinition agendaItemDefinition) throws RiceIllegalArgumentException;
401 
402     /**
403      * Delete the specified AgendaItem
404      *
405      * @param id identifier of the AgendaItem to be deleted
406      * @throws RiceIllegalArgumentException if the given id is null or invalid
407      */
408     @WebMethod(operationName = "deleteAgendaItem")
409     public void deleteAgendaItem(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
410 
411     ////
412     //// rule methods
413     ////
414     /**
415      * Create Rule
416      *
417      * @param ruleDefinition data for the new Rule to be created
418      * @return newly created Rule
419      * @throws RiceIllegalArgumentException if the given ruleDefinition is null
420      *                                      or invalid
421      */
422     @WebMethod(operationName = "createRule")
423     @WebResult(name = "rule")
424     public RuleDefinition createRule(@WebParam(name = "ruleDefinition") RuleDefinition ruleDefinition) throws RiceIllegalArgumentException;
425 
426     /**
427      * Retrieves the rule for the given ruleId.  The rule includes the
428      * propositions which define the condition that is to be evaluated on the
429      * rule.  It also defines a collection of actions which will be invoked if
430      * the rule succeeds.
431      *
432      * @param ruleId the id of the rule to retrieve
433      * @return the rule definition, or null if no rule could be located for the
434      *         given ruleId
435      * @throws IllegalArgumentException if the given ruleId is null
436      */
437     @WebMethod(operationName = "getRule")
438     @WebResult(name = "rule")
439     public RuleDefinition getRule(@WebParam(name = "ruleId") String ruleId);
440 
441     /**
442      * Retrieves an Rule from the repository based on the provided rule name
443      * and namespace.
444      *
445      * @param name the name of the Rule to retrieve.
446      * @param namespace the namespace that the rule is under.
447      * @return an {@link RuleDefinition} identified by the given name and namespace.
448      * A null reference is returned if an invalid or non-existent name and
449      * namespace combination is supplied.
450      * @throws IllegalArgumentException if the either the name or the namespace
451      * is null or blank.
452      */
453     @WebMethod(operationName = "getRuleByNameAndNamespace")
454     @WebResult(name = "rule")
455     public RuleDefinition getRuleByNameAndNamespace(@WebParam(name = "name") String name, 
456                                                     @WebParam(name = "namespace") String namespace);
457 	
458     /**
459      * Retrieves all of the rules for the given list of ruleIds.  The rule
460      * includes the propositions which define the condition that is to be
461      * evaluated on the rule.  It also defines a collection of actions which
462      * will be invoked if the rule succeeds.
463      * <p/>
464      * <p>The list which is returned from this operation may not be the same
465      * size as the list which is passed to this method.  If a rule doesn't exist
466      * for a given rule id then no result for that id will be returned in the
467      * list.  As a result of this, the returned list can be empty, but it will
468      * never be null.
469      *
470      * @param ruleIds the list of rule ids for which to retrieve the rules
471      * @return the list of rules for the given ids, this list will only contain
472      *         rules for the ids that were resolved successfully, it will never
473      *         return null but could return an empty list if no rules could be
474      *         loaded for the given set of ids
475      * @throws IllegalArgumentException if the given list of ruleIds is null
476      */
477     @WebMethod(operationName = "getRules")
478     @XmlElementWrapper(name = "rules", required = true)
479     @XmlElement(name = "rule", required = false)
480     @WebResult(name = "rules")
481     public List<RuleDefinition> getRules(@WebParam(name = "ruleIds") List<String> ruleIds);
482 
483     /**
484      * Update the Rule specified by the identifier in the DTO
485      *
486      * @param ruleDefinition updated Rule information, object specified by the id
487      * @throws RiceIllegalArgumentException if the given ruleDefinition is null
488      *                                      or invalid
489      */
490     @WebMethod(operationName = "updateRule")
491     public void updateRule(@WebParam(name = "ruleDefinition") RuleDefinition ruleDefinition) throws RiceIllegalArgumentException;
492 
493     /**
494      * Delete the specified Rule
495      *
496      * @param id identifier of the Rule to be deleted
497      * @throws RiceIllegalArgumentException if the given id is null or invalid
498      */
499     @WebMethod(operationName = "deleteRule")
500     public void deleteRule(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
501 
502     ////
503     //// action methods
504     ////
505     /**
506      * Create Action
507      *
508      * @param actionDefinition data for the new Action to be created
509      * @return newly created Action
510      * @throws RiceIllegalArgumentException if the given actionDefinition is null
511      * or invalid
512      */
513     @WebMethod(operationName = "createAction")
514     @WebResult(name = "action")
515     public ActionDefinition createAction(@WebParam(name = "actionDefinition") ActionDefinition actionDefinition) throws RiceIllegalArgumentException;
516 
517     /**
518      * Retrieves the action for the given actionId. The action includes the
519      * propositions which define the condition that is to be evaluated on the
520      * action. It also defines a collection of actions which will be invoked if
521      * the action succeeds.
522      *
523      * @param actionId the id of the action to retrieve
524      * @return the action definition, or null if no action could be located for the
525      * given actionId
526      * @throws IllegalArgumentException if the given actionId is null
527      */
528     @WebMethod(operationName = "getAction")
529     @WebResult(name = "action")
530     public ActionDefinition getAction(@WebParam(name = "actionId") String actionId) throws RiceIllegalArgumentException;
531 
532     /**
533      * Retrieves all of the actions for the given list of actionIds.
534      * <p/>
535      * <p>The list which is returned from this operation may not be the same
536      * size as the list which is passed to this method. If a action doesn't exist
537      * for a given action id then no result for that id will be returned in the
538      * list. As a result of this, the returned list can be empty, but it will
539      * never be null.
540      *
541      * @param actionIds the list of action ids for which to retrieve the actions
542      * @return the list of actions for the given ids, this list will only contain
543      * actions for the ids that were resolved successfully, it will never return
544      * null but could return an empty list if no actions could be loaded for the
545      * given set of ids
546      * @throws IllegalArgumentException if the given list of actionIds is null
547      */
548     @WebMethod(operationName = "getActions")
549     @XmlElementWrapper(name = "actions", required = true)
550     @XmlElement(name = "action", required = false)
551     @WebResult(name = "actions")
552     public List<ActionDefinition> getActions(@WebParam(name = "actionIds") List<String> actionIds)  throws RiceIllegalArgumentException;
553 
554     /**
555      * Update the Action specified by the identifier in the DTO
556      *
557      * @param actionDefinition updated Action information, object specified by the
558      * id
559      * @throws RiceIllegalArgumentException if the given actionDefinition is null
560      * or invalid
561      */
562     @WebMethod(operationName = "updateAction")
563     public void updateAction(@WebParam(name = "actionDefinition") ActionDefinition actionDefinition) throws RiceIllegalArgumentException;
564 
565     /**
566      * Delete the specified Action
567      *
568      * @param id identifier of the Action to be deleted
569      * @throws RiceIllegalArgumentException if the given id is null or invalid
570      */
571     @WebMethod(operationName = "deleteAction")
572     public void deleteAction(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
573   
574     
575     ////
576     //// proposition methods
577     ////
578     /**
579      * Create a Proposition
580      *
581      * @param propositionDefinition data for the new Proposition to be created
582      * @return newly created Proposition
583      * @throws RiceIllegalArgumentException if the given propositionDefinition
584      *                                      is null or invalid
585      */
586     @WebMethod(operationName = "createProposition")
587     @WebResult(name = "proposition")
588     public PropositionDefinition createProposition(@WebParam(name = "propositionDefinition") PropositionDefinition propositionDefinition) throws RiceIllegalArgumentException;
589 
590     /**
591      * Retrieve Proposition specified by the identifier
592      *
593      * @param id identifier of the Proposition to be retrieved
594      * @return specified Proposition
595      * @throws RiceIllegalArgumentException if the given id is null or invalid
596      */
597     @WebMethod(operationName = "getProposition")
598     @WebResult(name = "proposition")
599     public PropositionDefinition getProposition(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
600 
601     /**
602      * Retrieve Propositions of the specified type
603      *
604      * @param typeId type of the Propositions to be retrieved
605      * @return list of Propositions of the specified type
606      * @throws RiceIllegalArgumentException if the given typeId is null or
607      *                                      invalid
608      */
609     @WebMethod(operationName = "getPropositionsByType")
610     @XmlElementWrapper(name = "propositions", required = true)
611     @XmlElement(name = "proposition", required = false)
612     @WebResult(name = "propositions")
613     public Set<PropositionDefinition> getPropositionsByType(@WebParam(name = "typeId") String typeId) throws RiceIllegalArgumentException;
614 
615     /**
616      * Retrieve Propositions associated with the specified Rule
617      *
618      * @param ruleId identifier of the Rule to which the Propositions are associated with
619      * @return list of Propositions associated with the Rule
620      * @throws RiceIllegalArgumentException if the given ruleId is null or
621      *                                      invalid
622      */
623     @WebMethod(operationName = "getPropositionsByRule")
624     @XmlElementWrapper(name = "propositions", required = true)
625     @XmlElement(name = "proposition", required = false)
626     @WebResult(name = "propositions")
627     public Set<PropositionDefinition> getPropositionsByRule(@WebParam(name = "ruleId") String ruleId) throws RiceIllegalArgumentException;
628 
629     /**
630      * Update the Proposition
631      *
632      * @param propositionDefinition updated data for the Proposition, id specifies the object to be updated
633      * @throws RiceIllegalArgumentException if the given propositionDefinition
634      *                                      is null or invalid
635      */
636     @WebMethod(operationName = "updateProposition")
637     public void updateProposition(
638             @WebParam(name = "propositionDefinition") PropositionDefinition propositionDefinition) throws RiceIllegalArgumentException;
639 
640     /**
641      * Delete the Proposition
642      *
643      * @param id identifier of the Proposition to be deleted
644      * @throws RiceIllegalArgumentException if the given id is null or invalid
645      */
646     @WebMethod(operationName = "deleteProposition")
647     public void deleteProposition(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
648 
649     ////
650     //// natural language usages
651     ////
652     /**
653      * Create NaturalLanguageUsage
654      *
655      * @param naturalLanguageUsage data for the new NaturalLanguageUsage to be created
656      * @return newly created NaturalLanguageUsage
657      * @throws RiceIllegalArgumentException if the given naturalLanguageUsage is
658      *                                      null or invalid
659      */
660     @WebMethod(operationName = "createNaturalLanguageUsage")
661     @WebResult(name = "naturalLanguageUsage")
662     public NaturalLanguageUsage createNaturalLanguageUsage(@WebParam(name = "naturalLanguageUsage") NaturalLanguageUsage naturalLanguageUsage) throws RiceIllegalArgumentException;
663 
664     /**
665      * Retrieve NaturalLanguageUsage specified by the identifier
666      *
667      * @param id identifier of the NaturalLanguageUsage to be retrieved
668      * @return NaturalLanguageUsage specified by the identifier
669      * @throws RiceIllegalArgumentException if the given id is null or invalid
670      */
671     @WebMethod(operationName = "getNaturalLanguageUsage")
672     @WebResult(name = "naturalLanguageUsage")
673     public NaturalLanguageUsage getNaturalLanguageUsage(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
674 
675     /**
676      * Retrieve NaturalLanguageUsage specified by name and namespace
677      *
678      * @param name the name of the natural language usage to retrieve.
679      * @param namespace the namespace that the natural language usage is under.
680      * @return an {@link NaturalLanguageUsage} identified by the given name and
681      * namespace. A null reference is returned if an invalid or non-existent
682      * name and namespace combination is supplied.
683      * @throws RiceIllegalArgumentException if the either the name or the
684      * namespace is null or blank.
685      */
686     @WebMethod(operationName = "getNaturalLanguageUsageByNameAndNamespace")
687     @WebResult(name = "naturalLanguageUsage")
688     public NaturalLanguageUsage getNaturalLanguageUsageByNameAndNamespace(@WebParam(name = "name") String name,
689             @WebParam(name = "namespace") String namespace)
690             throws RiceIllegalArgumentException;
691 
692     /**
693      * Update NaturalLanguageUsage
694      *
695      * @param naturalLanguageUsage updated data for the NaturalLanguageUsage object specified by the id
696      * @throws RiceIllegalArgumentException if the given naturalLanguageUsage is
697      *                                      null or invalid
698      */
699     @WebMethod(operationName = "updateNaturalLanguageUsage")
700     public void updateNaturalLanguageUsage(@WebParam(name = "naturalLanguageUsage") NaturalLanguageUsage naturalLanguageUsage) throws RiceIllegalArgumentException;
701 
702     /**
703      * Delete NaturalLanguageUsage
704      *
705      * @param naturalLanguageUsageId  identifier of the NaturalLanguageUsage to be deleted
706      * @throws RiceIllegalArgumentException  if the given naturalLanguageUsageId is null or invalid
707      */
708     @WebMethod(operationName = "deleteNaturalLanguageUsage")
709     public void deleteNaturalLanguageUsage(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId) throws RiceIllegalArgumentException;
710 
711     /**
712      * Translates and retrieves a NaturalLanguage for a given KRMS object (e.g, proposition
713      * or agenda), NaturalLanguage usage type (context) and language into natural language
714      * TODO: Add appropriate caching annotation
715      *
716      * @param namespace namespace to search on.
717      * @return list of NaturalLanguageUsages in a particular namespace
718      */
719     @WebMethod(operationName = "getNaturalLanguageUsagesByNamespace")
720     @XmlElementWrapper(name = "naturalLanguageUsages", required = true)
721     @XmlElement(name = "naturalLanguageUsage", required = false)
722     @WebResult(name = "naturalLanguageUsages")
723     public List<NaturalLanguageUsage> getNaturalLanguageUsagesByNamespace(@WebParam(name = "namespace") String namespace)
724             throws RiceIllegalArgumentException;
725 
726     ////
727     //// context methods
728     ////
729     /**
730      * Create Context
731      *
732      * @param contextDefinition data for the new Context to be created
733      * @return newly created Context
734      * @throws RiceIllegalArgumentException if the given contextDefinition is
735      * null or invalid or already in use.
736      */
737     @WebMethod(operationName = "createContext")
738     @WebResult(name = "context")
739     public ContextDefinition createContext(@WebParam(name = "contextDefinition") ContextDefinition contextDefinition) throws RiceIllegalArgumentException;
740 
741     
742     /**
743      * find Create Context
744      * 
745      * Searches for an existing context with the same name and namespace and returns it
746      * otherwise it creates the context.
747      *
748      * @param contextDefinition data for the new Context to be created
749      * @return newly created Context
750      * @throws RiceIllegalArgumentException if the given contextDefinition is
751      * null or invalid
752      */
753     @WebMethod(operationName = "findCreateContext")
754     @WebResult(name = "context")
755     public ContextDefinition findCreateContext(@WebParam(name = "contextDefinition") ContextDefinition contextDefinition) throws RiceIllegalArgumentException;
756 
757     
758     /**
759      * Update the Context specified by the identifier in the input DTO
760      *
761      * @param contextDefinition DTO with updated info and identifier of the
762      * object to be updated
763      * @throws RiceIllegalArgumentException if the given contextDefinition is
764      * null or invalid
765      */
766     @WebMethod(operationName = "updateContext")
767     public void updateContext(@WebParam(name = "contextDefinition") ContextDefinition contextDefinition) throws RiceIllegalArgumentException;
768 
769     /**
770      * Delete the specified Context
771      *
772      * @param id identifier of the object to be deleted
773      * @throws RiceIllegalArgumentException if the given id is null or invalid
774      */
775     @WebMethod(operationName = "deleteContext")
776     public void deleteContext(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
777 
778     /**
779      * Retrieve Context for the specified id
780      *
781      * @param id identifier for the Context
782      * @return specified Context
783      * @throws RiceIllegalArgumentException if the given id is null or invalid
784      */
785     @WebMethod(operationName = "getContext")
786     @WebResult(name = "context")
787     public ContextDefinition getContext(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
788 
789     /**
790      * Retrieves an Context from the repository based on the provided context
791      * name and namespace.
792      *
793      * @param name the name of the Context to retrieve.
794      * @param namespace the namespace that the context is under.
795      * @return an {@link ContextDefinition} identified by the given name and
796      * namespace. A null reference is returned if an invalid or non-existent
797      * name and namespace combination is supplied.
798      * @throws RiceIllegalArgumentException if the either the name or the
799      * namespace is null or blank.
800      */
801     @WebMethod(operationName = "getContextByNameAndNamespace")
802     @WebResult(name = "context")
803     public ContextDefinition getContextByNameAndNamespace(@WebParam(name = "name") String name,
804             @WebParam(name = "namespace") String namespace)
805             throws RiceIllegalArgumentException;
806 
807     //// natural languatge template methods
808     /**
809      * This will create a {@link NaturalLanguageTemplate} exactly like the
810      * parameter passed in except the id will be assigned and create date/user 
811      * will be set.
812      *
813      * @param naturalLanguageTemplate The NaturalLanguageTemplate to create.
814      * @throws RiceIllegalArgumentException if the NaturalLanguageTemplate is null.
815      * @throws IllegalStateException if the NaturalLanguageTemplate already
816      * exists in the system.
817      * @return a {@link NaturalLanguageTemplate} exactly like the parameter
818      * passed in.
819      *
820      */
821     @WebMethod(operationName = "createNaturalLanguageTemplate")
822     @WebResult(name = "naturalLanguageTemplate")
823     public NaturalLanguageTemplate createNaturalLanguageTemplate(@WebParam(name = "naturalLanguageTemplate") NaturalLanguageTemplate naturalLanguageTemplate)
824             throws RiceIllegalArgumentException;
825 
826     /**
827      * Retrieves a NaturalLanguageTemplate from the repository based on the
828      * given id.
829      *
830      * @param naturalLanguageTemplateId to retrieve.
831      * @return a {@link NaturalLanguageTemplate} identified by the given id. 
832      * @throws IllegalArgumentException if the given actionId is null     *
833      */
834     @WebMethod(operationName = "getNaturalLanguageTemplate")
835     @WebResult(name = "naturalLanguageTemplate")
836     public NaturalLanguageTemplate getNaturalLanguageTemplate(@WebParam(name = "naturalLanguageTemplateId") String naturalLanguageTemplateId)
837             throws RiceIllegalArgumentException;
838 
839     /**
840      * This will update an existing {@link NaturalLanguageTemplate}.
841      *
842      * @param naturalLanguageTemplate The NaturalLanguageTemplate to update.
843      * @throws RiceIllegalArgumentException if the NaturalLanguageTemplate is null.
844      * exists in the system.
845      *
846      */
847     @WebMethod(operationName = "updateNaturalLanguageTemplate")
848     public void updateNaturalLanguageTemplate(@WebParam(name = "naturalLanguageTemplate") NaturalLanguageTemplate naturalLanguageTemplate)
849             throws RiceIllegalArgumentException;
850 
851     /**
852      * Delete the {@link NaturalLanguageTemplate} with the given id.
853      *
854      * @param naturalLanguageTemplateId to delete.
855      * @throws RiceIllegalArgumentException if the NaturalLanguageTemplate is null.
856      *
857      */
858     @WebMethod(operationName = "deleteNaturalLanguageTemplate")
859     public void deleteNaturalLanguageTemplate(@WebParam(name = "naturalLanguageTemplateId") String naturalLanguageTemplateId)
860             throws RiceIllegalArgumentException;
861 
862     /**
863      * Finds all the natural language templates for a particular language
864      *
865      * @param languageCode language on which to search
866      * @return list of templates for that language
867      */
868     @WebMethod(operationName = "findNaturalLanguageTemplatesByLanguageCode")
869     @XmlElementWrapper(name = "naturalLangaugeTemplates", required = true)
870     @XmlElement(name = "naturalLangaugeTemplate", required = false)
871     @WebResult(name = "naturalLangaugeTemplates")
872     public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByLanguageCode(@WebParam(name = "languageCode") String languageCode)
873             throws RiceIllegalArgumentException;
874 
875     @WebMethod(operationName = "findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId")
876     @WebResult(name = "naturalLangaugeTemplate")
877     public NaturalLanguageTemplate findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId(@WebParam(name = "languageCode") String languageCode,
878             @WebParam(name = "typeId") String typeId,
879             @WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId)
880             throws RiceIllegalArgumentException;
881 
882     /**
883      * Find all the natural language templates for a particular usage
884      *
885      * @param naturalLanguageUsageId the usage on which to search
886      * @return list of templates that match the usage
887      */
888     @WebMethod(operationName = "findNaturalLanguageTemplatesByNaturalLanguageUsage")
889     @XmlElementWrapper(name = "naturalLangaugeTemplates", required = true)
890     @XmlElement(name = "naturalLangaugeTemplate", required = false)
891     @WebResult(name = "naturalLangaugeTemplates")
892     public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByNaturalLanguageUsage(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId)
893             throws RiceIllegalArgumentException;
894 
895     /**
896      * Find all the natural language templates of a particular type
897      *
898      * Template types are keys that identify the message that is to be expressed
899      * in different languages and in different usage scenarios
900      *
901      * @param typeId on which to search
902      * @return list of templates matching that type
903      */
904     @WebMethod(operationName = "findNaturalLanguageTemplatesByType")
905     @XmlElementWrapper(name = "naturalLangaugeTemplates", required = true)
906     @XmlElement(name = "naturalLangaugeTemplate", required = false)
907     @WebResult(name = "naturalLangaugeTemplates")
908     public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByType(@WebParam(name = "typeId") String typeId)
909             throws RiceIllegalArgumentException;
910 
911     /**
912      * Find the natural language template using the actual text of the template.
913      *
914      * @param template text to match exactly
915      * @return list of matching templates
916      */
917     @WebMethod(operationName = "findNaturalLanguageTemplatesByTemplate")
918     @XmlElementWrapper(name = "naturalLangaugeTemplates", required = true)
919     @XmlElement(name = "naturalLangaugeTemplate", required = false)
920     @WebResult(name = "naturalLangaugeTemplates")
921     public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByTemplate(@WebParam(name = "template") String template)
922             throws RiceIllegalArgumentException;
923 
924     ////
925     //// translation methods
926     ////
927     /**
928      * Translates and retrieves a NaturalLanguage for a given KRMS object (e.g,
929      * proposition or agenda), NaturalLanguage usage type (context) and language
930      * into natural language TODO: Add appropriate caching annotation
931      *
932      * @param naturalLanguageUsageId Natural language usage information
933      * @param typeId    KRMS object type id (for example, could refer to agenda
934      *                  or proposition)
935      * @param krmsObjectId KRMS object identifier
936      * @param languageCode  desired
937      * @return natural language corresponding to the NaturalLanguage usage, KRMS object id, KRMS object type and desired language
938      * @throws RiceIllegalArgumentException if the given naturalLanguageUsageId, typeId,
939      *                                      krmsObjectId or language is null or
940      *                                      invalid
941      */
942     @WebMethod(operationName = "translateNaturalLanguageForObject")
943     @WebResult(name = "naturalLanguage")
944     @Override
945     public String translateNaturalLanguageForObject(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId,
946             @WebParam(name = "typeId") String typeId, @WebParam(name = "krmsObjectId") String krmsObjectId,
947             @WebParam(name = "languageCode") String languageCode) throws RiceIllegalArgumentException;
948 
949     /**
950      * Retrieve all the NaturalLanguageUsages
951      *
952      * @return list of NaturalLanguageUsages
953      */
954     @WebMethod(operationName = "translateNaturalLanguageForProposition")
955     @WebResult(name = "naturalLanguage")
956     @Override
957     public String translateNaturalLanguageForProposition(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId,
958             @WebParam(name = "propositionDefinintion") PropositionDefinition propositionDefinintion,
959             @WebParam(name = "languageCode") String languageCode)
960             throws RiceIllegalArgumentException;
961 
962     /**
963      * Translates NaturalLanguage for a given proposition, returning a tree of
964      * the NaturalLanguage.
965      *
966      * This method is used to "preview" the proposition in a tree structure
967      * before saving.
968      *
969      * @param naturalLanguageUsageId Natural language usage information
970      * @param propositionDefinintion proposition to be translated
971      * @param languageCode desired
972      * @return natural language tree corresponding to the NaturalLanguage usage,
973      * proposition and desired language
974      * @throws RiceIllegalArgumentException if the given naturalLanguageUsageId,
975      * proposition, or language is null or invalid
976      */
977     @WebMethod(operationName = "translateNaturalLanguageTreeForProposition")
978     @WebResult(name = "naturalLanguageTree")
979     @Override
980     public NaturalLanguageTree translateNaturalLanguageTreeForProposition(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId,
981             @WebParam(name = "propositionDefinintion") PropositionDefinition propositionDefinintion,
982             @WebParam(name = "languageCode") String languageCode)
983             throws RiceIllegalArgumentException;
984 
985   
986     /**
987      * Query for Context ids based on the given search criteria which is a Map
988      * of Context field names to values.
989      * <p/>
990      * <p> This method returns it's results as a List of Context ids that match
991      * the given search criteria. </p>
992      *
993      * @param queryByCriteria the criteria. Cannot be null.
994      * @return a list of ids matching the given criteria properties. An empty
995      * list is returned if an invalid or non-existent criteria is supplied.
996      * @throws RiceIllegalArgumentException if the queryByCriteria is null
997      */
998     @WebMethod(operationName = "findContextIds")
999     @XmlElementWrapper(name = "contextIds", required = true)
1000     @XmlElement(name = "context", required = false)
1001     @WebResult(name = "contextIds")
1002     List<String> findContextIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
1003 
1004     /**
1005      * Query for Agenda ids based on the given search criteria which is a Map of
1006      * Agenda field names to values.
1007      * <p/>
1008      * <p> This method returns it's results as a List of Agenda ids that match
1009      * the given search criteria. </p>
1010      *
1011      * @param queryByCriteria the criteria. Cannot be null.
1012      * @return a list of ids matching the given criteria properties. An empty
1013      * list is returned if an invalid or non-existent criteria is supplied.
1014      * @throws RiceIllegalArgumentException if the queryByCriteria is null
1015      */
1016     @WebMethod(operationName = "findAgendaIds")
1017     @XmlElementWrapper(name = "contextIds", required = true)
1018     @XmlElement(name = "agenda", required = false)
1019     @WebResult(name = "agendaIds")
1020     List<String> findAgendaIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
1021 
1022     /**
1023      * Query for Rule ids based on the given search criteria which is a Map of
1024      * Rule field names to values.
1025      * <p/>
1026      * <p> This method returns it's results as a List of Rule ids that match the
1027      * given search criteria. </p>
1028      *
1029      * @param queryByCriteria the criteria. Cannot be null.
1030      * @return a list of ids matching the given criteria properties. An empty
1031      * list is returned if an invalid or non-existent criteria is supplied.
1032      * @throws RiceIllegalArgumentException if the queryByCriteria is null
1033      */
1034     @WebMethod(operationName = "findRuleIds")
1035     @XmlElementWrapper(name = "ruleIds", required = true)
1036     @XmlElement(name = "rule", required = false)
1037     @WebResult(name = "ruleIds")
1038     List<String> findRuleIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
1039 
1040     /**
1041      * Query for Proposition ids based on the given search criteria which is a
1042      * Map of Proposition field names to values.
1043      * <p/>
1044      * <p> This method returns it's results as a List of Proposition ids that
1045      * match the given search criteria. </p>
1046      *
1047      * @param queryByCriteria the criteria. Cannot be null.
1048      * @return a list of ids matching the given criteria properties. An empty
1049      * list is returned if an invalid or non-existent criteria is supplied.
1050      * @throws RiceIllegalArgumentException if the queryByCriteria is null
1051      */
1052     @WebMethod(operationName = "findPropositionIds")
1053     @XmlElementWrapper(name = "propositionIds", required = true)
1054     @XmlElement(name = "proposition", required = false)
1055     @WebResult(name = "propositionIds")
1056     List<String> findPropositionIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
1057 
1058     /**
1059      * Query for Action ids based on the given search criteria which is a Map
1060      * of Action field names to values.
1061      * <p/>
1062      * <p> This method returns it's results as a List of Action ids that match
1063      * the given search criteria. </p>
1064      *
1065      * @param queryByCriteria the criteria. Cannot be null.
1066      * @return a list of ids matching the given criteria properties. An empty
1067      * list is returned if an invalid or non-existent criteria is supplied.
1068      * @throws RiceIllegalArgumentException if the queryByCriteria is null
1069      */
1070     @WebMethod(operationName = "findActionIds")
1071     @XmlElementWrapper(name = "actionIds", required = true)
1072     @XmlElement(name = "action", required = false)
1073     @WebResult(name = "actionIds")
1074     List<String> findActionIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
1075     
1076     ////
1077     //// extra methods from RuleRepositoryService copied here so I can break the dependence on that service
1078     //// and then implement different caching schemes for each 
1079     ////
1080     
1081     
1082       /**
1083      * Locates a ContextDefinition based on the given map of context qualifiers.
1084      * The requirements for valid selection criteria are implementation
1085      * dependent. An IllegalArgumentException may be thrown if the
1086      * implementation can't operate with the given criteria.
1087      *
1088      * @param contextSelectionCriteria
1089      * @return
1090      * @see ContextSelectionCriteria
1091      * @throws RiceIllegalArgumentException if the implementation can't handle
1092      * the given ContextSelectionCriteria
1093      */
1094     @WebMethod(operationName = "selectContext")
1095     @WebResult(name = "contextDefinition")
1096     public ContextDefinition selectContext(@WebParam(name = "contextSelectionCriteria") ContextSelectionCriteria contextSelectionCriteria)
1097             throws RiceIllegalArgumentException;
1098 
1099     /**
1100      * Retrieves the agenda tree for the given agendaId. The agenda tree
1101      * includes the entire agenda definition in the appropriate order and with
1102      * the defined agenda branching.
1103      *
1104      * @param agendaId the id of the agenda for which to retrieve the agenda
1105      * tree
1106      * @return the agenda tree, or null if no agenda could be located for the
1107      * given agendaId
1108      *
1109      * @throws RiceIllegalArgumentException if the given agendaId is null
1110      */
1111     @WebMethod(operationName = "getAgendaTree")
1112     @WebResult(name = "agendaTree")
1113     public AgendaTreeDefinition getAgendaTree(@WebParam(name = "agendaId") String agendaId)
1114             throws RiceIllegalArgumentException;
1115 
1116     /**
1117      * Retrieves all of the agendas trees for the given list of agendaIds. The
1118      * agenda tree includes the entire agenda definition in the appropriate
1119      * order and with the defined agenda branching.
1120      *
1121      * <p>The list which is returned from this operation may not be the same
1122      * size as the list which is passed to this method. If an agenda doesn't
1123      * exist for a given agenda id then no result for that id will be returned
1124      * in the list. As a result of this, the returned list can be empty, but it
1125      * will never be null.
1126      *
1127      * @param agendaIds the list of agenda ids for which to retrieve the agenda
1128      * trees
1129      * @return the list of agenda trees for the given ids, this list will only
1130      * contain agenda trees for the ids that were resolved successfully, it will
1131      * never return null but could return an empty list if no agenda trees could
1132      * be loaded for the given set of ids
1133      *
1134      * @throws RiceIllegalArgumentException if the given list of agendaIds is
1135      * null
1136      */
1137     @WebMethod(operationName = "getAgendaTrees")
1138     @XmlElementWrapper(name = "agendaTrees", required = true)
1139     @XmlElement(name = "agendaTree", required = false)
1140     @WebResult(name = "agendaTrees")
1141     public List<AgendaTreeDefinition> getAgendaTrees(@WebParam(name = "agendaIds") List<String> agendaIds)
1142             throws RiceIllegalArgumentException;
1143 
1144    
1145 }