org.kuali.rice.krms.api.repository
Interface RuleManagementService

All Superinterfaces:
RuleRepositoryService
All Known Implementing Classes:
RuleManagementServiceImpl

public interface RuleManagementService
extends RuleRepositoryService

The rule maintenance service operations facilitate management of rules and associated information.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 AgendaDefinition createAgenda(AgendaDefinition agendaDefinition)
          Create Agenda
 AgendaItemDefinition createAgendaItem(AgendaItemDefinition agendaItemDefinition)
          Create AgendaItem
 NaturalLanguageUsage createNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage)
          Create NaturalLanguageUsage
 PropositionDefinition createProposition(PropositionDefinition propositionDefinition)
          Create a Proposition
 ReferenceObjectBinding createReferenceObjectBinding(ReferenceObjectBinding referenceObjectDefinition)
          Create RefObject-KRMS object binding
 RuleDefinition createRule(RuleDefinition ruleDefinition)
          Create Rule
 void deleteAgenda(String id)
          Delete the specified Agenda
 void deleteAgendaItem(String id)
          Delete the specified AgendaItem
 void deleteNaturalLanguageUsageType(String naturalLanguageUsageId)
          Delete NaturalLanguageUsage
 void deleteProposition(String id)
          Delete the Proposition
 void deleteReferenceObjectBinding(String id)
          Delete the specified ReferenceObjectBinding object
 void deleteRule(String id)
          Delete the specified Rule
 List<String> findReferenceObjectBindingIds(QueryByCriteria queryByCriteria)
          Query for ReferenceObjectBinding ids based on the given search criteria which is a Map of ReferenceObjectBinding field names to values.
 List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsDiscriminatorType(String referenceObjectKrmsDiscriminatorType)
          Retrieves list of ReferenceObjectBinding objects for the given krms obj discriminator type
 List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsObject(String krmsObjectId)
          Retrieves list of ReferenceObjectBinding objects for the given KRMS obj id.
 List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceDiscriminatorType(String referenceObjectReferenceDiscriminatorType)
          Retrieves list of ReferenceObjectBinding objects for the given ref obj discriminator type
 AgendaDefinition getAgenda(String id)
          Retrieve Agenda for the specified id
 AgendaItemDefinition getAgendaItem(String id)
          Retrieve AgendaItem by the specified identifier
 List<AgendaItemDefinition> getAgendaItemsByContext(String contextId)
          Retrieve AgendaItems associated with a context
 List<AgendaItemDefinition> getAgendaItemsByType(String typeId)
          Retrieve AgendaItems by specified type
 List<AgendaItemDefinition> getAgendaItemsByTypeAndContext(String typeId, String contextId)
          Retrieve AgendaItems by type and context
 List<AgendaDefinition> getAgendasByContext(String contextId)
          Retrieve Agendas associated with the specified context
 List<AgendaDefinition> getAgendasByType(String typeId)
          Retrieve Agendas of the specified type
 List<AgendaDefinition> getAgendasByTypeAndContext(String typeId, String contextId)
          Retrieve Agendas of the specified type and context
 String getNaturalLanguageForType(String naturalLanguageUsageId, String typeId, String krmsObjectId, String languageCode)
          Translates and retrieves a NaturalLanguage for a given KRMS object (e.g, proposition or agenda), NaturalLanguage usage type (context) and language into natural language TODO: Add appropriate caching annotation
 NaturalLanguageUsage getNaturalLanguageUsage(String id)
          Retrieve NaturalLanguageUsage specified by the identifier
 Set<NaturalLanguageUsage> getNaturalLanguageUsages()
          Retrieve all the NaturalLanguageUsages
 PropositionDefinition getProposition(String id)
          Retrieve Proposition specified by the identifier
 Set<PropositionDefinition> getPropositionsByRule(String ruleId)
          Retrieve Propositions associated with the specified Rule
 Set<PropositionDefinition> getPropositionsByType(String typeId)
          Retrieve Propositions of the specified type
 ReferenceObjectBinding getReferenceObjectBinding(String id)
          Retrieve referenceObjectBinding given a specific id
 List<ReferenceObjectBinding> getReferenceObjectBindings(List<String> ids)
          Retrieve list of ReferenceObjectBinding objects given ids
 RuleDefinition getRule(String ruleId)
          Retrieves the rule for the given ruleId.
 List<RuleDefinition> getRules(List<String> ruleIds)
          Retrieves all of the rules for the given list of ruleIds.
 void updateAgenda(AgendaDefinition agendaDefinition)
          Update the Agenda specified by the identifier in the input DTO
 void updateAgendaItem(AgendaItemDefinition agendaItemDefinition)
          Update an AgendaItem
 void updateNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage)
          Update NaturalLanguageUsage
 void updateProposition(PropositionDefinition propositionDefinition)
          Update the Proposition
 void updateReferenceObjectBinding(ReferenceObjectBinding referenceObjectBindingDefinition)
          Update the ReferenceObjectBinding object specified by the identifier in the given DTO
 void updateRule(RuleDefinition ruleDefinition)
          Update the Rule specified by the identifier in the DTO
 
Methods inherited from interface org.kuali.rice.krms.api.repository.RuleRepositoryService
getAgendaTree, getAgendaTrees, selectContext
 

Method Detail

createReferenceObjectBinding

ReferenceObjectBinding createReferenceObjectBinding(ReferenceObjectBinding referenceObjectDefinition)
                                                    throws RiceIllegalArgumentException
Create RefObject-KRMS object binding

Parameters:
referenceObjectDefinition - data for the new ReferenceObjectBinding to be created
Returns:
newly created ReferenceObjectBinding
Throws:
RiceIllegalArgumentException - if the given referenceObjectDefinition is null or invalid

getReferenceObjectBinding

ReferenceObjectBinding getReferenceObjectBinding(String id)
                                                 throws RiceIllegalArgumentException
Retrieve referenceObjectBinding given a specific id

Parameters:
id - identifier of the ReferenceObjectBinding to be retrieved
Returns:
a ReferenceObjectBinding with the given id value
Throws:
RiceIllegalArgumentException - if the given id is blank or invalid

getReferenceObjectBindings

List<ReferenceObjectBinding> getReferenceObjectBindings(List<String> ids)
                                                        throws RiceIllegalArgumentException
Retrieve list of ReferenceObjectBinding objects given ids

Parameters:
ids - identifiers of the ReferenceObjectBinding to be retrieved
Returns:
list of ReferenceObjectBinding objects for the given ids
Throws:
RiceIllegalArgumentException - if one or more ids in the give list is blank or invalid

findReferenceObjectBindingsByReferenceDiscriminatorType

List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceDiscriminatorType(String referenceObjectReferenceDiscriminatorType)
                                                                                     throws RiceIllegalArgumentException
Retrieves list of ReferenceObjectBinding objects for the given ref obj discriminator type

Parameters:
referenceObjectReferenceDiscriminatorType - reference object type
Returns:
list of ReferenceObjectBinding objects for the given discriminator type
Throws:
RiceIllegalArgumentException - if the given referenceObjectReferenceDiscriminatorType is blank or invalid

findReferenceObjectBindingsByKrmsDiscriminatorType

List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsDiscriminatorType(String referenceObjectKrmsDiscriminatorType)
                                                                                throws RiceIllegalArgumentException
Retrieves list of ReferenceObjectBinding objects for the given krms obj discriminator type

Parameters:
referenceObjectKrmsDiscriminatorType - reference object type
Returns:
list of ReferenceObjectBinding objects for the given discriminator type
Throws:
RiceIllegalArgumentException - if the given referenceObjectKrmsDiscriminatorType is blank or invalid

findReferenceObjectBindingsByKrmsObject

List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsObject(String krmsObjectId)
                                                                     throws RiceIllegalArgumentException
Retrieves list of ReferenceObjectBinding objects for the given KRMS obj id.

Parameters:
krmsObjectId - identifier of the KRMS obj
Returns:
list of ReferenceObjectBinding objects for the given KRMS obj
Throws:
RiceIllegalArgumentException - if the given krmsObjectId is blank or invalid

updateReferenceObjectBinding

void updateReferenceObjectBinding(ReferenceObjectBinding referenceObjectBindingDefinition)
                                  throws RiceIllegalArgumentException
Update the ReferenceObjectBinding object specified by the identifier in the given DTO

Parameters:
referenceObjectBindingDefinition - DTO with updated info and id of the object to be updated
Throws:
RiceIllegalArgumentException - if the given referenceObjectBindingDefinition is null or invalid

deleteReferenceObjectBinding

void deleteReferenceObjectBinding(String id)
                                  throws RiceIllegalArgumentException
Delete the specified ReferenceObjectBinding object

Parameters:
id - identifier of the object to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

findReferenceObjectBindingIds

List<String> findReferenceObjectBindingIds(QueryByCriteria queryByCriteria)
                                           throws RiceIllegalArgumentException
Query for ReferenceObjectBinding ids based on the given search criteria which is a Map of ReferenceObjectBinding field names to values.

This method returns it's results as a List of ReferenceObjectBinding ids that match the given search criteria.

Parameters:
queryByCriteria - the criteria. Cannot be null.
Returns:
a list of ids matching the given criteria properties. An empty list is returned if an invalid or non-existent criteria is supplied.
Throws:
RiceIllegalArgumentException - if the queryByCriteria is null

createAgenda

AgendaDefinition createAgenda(AgendaDefinition agendaDefinition)
                              throws RiceIllegalArgumentException
Create Agenda

Parameters:
agendaDefinition - data for the new Agenda to be created
Returns:
newly created Agenda
Throws:
RiceIllegalArgumentException - if the given agendaDefinition is null or invalid

getAgenda

AgendaDefinition getAgenda(String id)
                           throws RiceIllegalArgumentException
Retrieve Agenda for the specified id

Parameters:
id - identifier for the Agenda
Returns:
specified Agenda
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getAgendasByType

List<AgendaDefinition> getAgendasByType(String typeId)
                                        throws RiceIllegalArgumentException
Retrieve Agendas of the specified type

Parameters:
typeId - type of the Agenda
Returns:
list of Agendas of the specified type
Throws:
RiceIllegalArgumentException - if the given typeId is null or invalid

getAgendasByContext

List<AgendaDefinition> getAgendasByContext(String contextId)
                                           throws RiceIllegalArgumentException
Retrieve Agendas associated with the specified context

Parameters:
contextId - context of interest
Returns:
list of Agendas associated with the context
Throws:
RiceIllegalArgumentException - if the given contextId is null or invalid

getAgendasByTypeAndContext

List<AgendaDefinition> getAgendasByTypeAndContext(String typeId,
                                                  String contextId)
                                                  throws RiceIllegalArgumentException
Retrieve Agendas of the specified type and context

Parameters:
typeId - type of the Agenda
contextId - context of interest
Returns:
list of Agendas associated with the specified type and context
Throws:
RiceIllegalArgumentException - if the given typeId or contextId null or invalid

updateAgenda

void updateAgenda(AgendaDefinition agendaDefinition)
                  throws RiceIllegalArgumentException
Update the Agenda specified by the identifier in the input DTO

Parameters:
agendaDefinition - DTO with updated info and identifier of the object to be updated
Throws:
RiceIllegalArgumentException - if the given agendaDefinition is null or invalid

deleteAgenda

void deleteAgenda(String id)
                  throws RiceIllegalArgumentException
Delete the specified Agenda

Parameters:
id - identifier of the object to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

createAgendaItem

AgendaItemDefinition createAgendaItem(AgendaItemDefinition agendaItemDefinition)
                                      throws RiceIllegalArgumentException
Create AgendaItem

Parameters:
agendaItemDefinition - data for the new AgendaItem to be created
Returns:
newly created AgendaItem
Throws:
RiceIllegalArgumentException - if the given agendaItemDefinition is null or invalid

getAgendaItem

AgendaItemDefinition getAgendaItem(String id)
                                   throws RiceIllegalArgumentException
Retrieve AgendaItem by the specified identifier

Parameters:
id - identifier of the AgendaItem
Returns:
AgendaItem specified by the identifier
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getAgendaItemsByType

List<AgendaItemDefinition> getAgendaItemsByType(String typeId)
                                                throws RiceIllegalArgumentException
Retrieve AgendaItems by specified type

Parameters:
typeId - type of the AgendaItems
Returns:
list of AgendaItems of the specified type
Throws:
RiceIllegalArgumentException - if the given typeId is null or invalid

getAgendaItemsByContext

List<AgendaItemDefinition> getAgendaItemsByContext(String contextId)
                                                   throws RiceIllegalArgumentException
Retrieve AgendaItems associated with a context

Parameters:
contextId - context identifier
Returns:
list of AgendaItems associated with a context
Throws:
RiceIllegalArgumentException - if the given contextId is null or invalid

getAgendaItemsByTypeAndContext

List<AgendaItemDefinition> getAgendaItemsByTypeAndContext(String typeId,
                                                          String contextId)
                                                          throws RiceIllegalArgumentException
Retrieve AgendaItems by type and context

Parameters:
typeId - type of the Agendas
contextId - context with which the Agendas are associated
Returns:
list of AgendaItems of the specified type and context
Throws:
RiceIllegalArgumentException - if the given typeId or contextId null or invalid

updateAgendaItem

void updateAgendaItem(AgendaItemDefinition agendaItemDefinition)
                      throws RiceIllegalArgumentException
Update an AgendaItem

Parameters:
agendaItemDefinition - updated data for the AgendaItem, with id of the object to be updated
Throws:
RiceIllegalArgumentException - if the given agendaItemDefinition is null or invalid

deleteAgendaItem

void deleteAgendaItem(String id)
                      throws RiceIllegalArgumentException
Delete the specified AgendaItem

Parameters:
id - identifier of the AgendaItem to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

createRule

RuleDefinition createRule(RuleDefinition ruleDefinition)
                          throws RiceIllegalArgumentException
Create Rule

Parameters:
ruleDefinition - data for the new Rule to be created
Returns:
newly created Rule
Throws:
RiceIllegalArgumentException - if the given ruleDefinition is null or invalid

getRule

@Cacheable(value="http://rice.kuali.org/krms/v2_0/RuleType",
           key="\'ruleId=\' + #p0")
RuleDefinition getRule(String ruleId)
Retrieves the rule for the given ruleId. The rule includes the propositions which define the condition that is to be evaluated on the rule. It also defines a collection of actions which will be invoked if the rule succeeds.

Specified by:
getRule in interface RuleRepositoryService
Parameters:
ruleId - the id of the rule to retrieve
Returns:
the rule definition, or null if no rule could be located for the given ruleId
Throws:
IllegalArgumentException - if the given ruleId is null

getRules

List<RuleDefinition> getRules(List<String> ruleIds)
Retrieves all of the rules for the given list of ruleIds. The rule includes the propositions which define the condition that is to be evaluated on the rule. It also defines a collection of actions which will be invoked if the rule succeeds.

The list which is returned from this operation may not be the same size as the list which is passed to this method. If a rule doesn't exist for a given rule id then no result for that id will be returned in the list. As a result of this, the returned list can be empty, but it will never be null.

Specified by:
getRules in interface RuleRepositoryService
Parameters:
ruleIds - the list of rule ids for which to retrieve the rules
Returns:
the list of rules for the given ids, this list will only contain rules for the ids that were resolved successfully, it will never return null but could return an empty list if no rules could be loaded for the given set of ids
Throws:
IllegalArgumentException - if the given list of ruleIds is null

updateRule

void updateRule(RuleDefinition ruleDefinition)
                throws RiceIllegalArgumentException
Update the Rule specified by the identifier in the DTO

Parameters:
ruleDefinition - updated Rule information, object specified by the id
Throws:
RiceIllegalArgumentException - if the given ruleDefinition is null or invalid

deleteRule

void deleteRule(String id)
                throws RiceIllegalArgumentException
Delete the specified Rule

Parameters:
id - identifier of the Rule to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

createProposition

PropositionDefinition createProposition(PropositionDefinition propositionDefinition)
                                        throws RiceIllegalArgumentException
Create a Proposition

Parameters:
propositionDefinition - data for the new Proposition to be created
Returns:
newly created Proposition
Throws:
RiceIllegalArgumentException - if the given propositionDefinition is null or invalid

getProposition

PropositionDefinition getProposition(String id)
                                     throws RiceIllegalArgumentException
Retrieve Proposition specified by the identifier

Parameters:
id - identifier of the Proposition to be retrieved
Returns:
specified Proposition
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getPropositionsByType

Set<PropositionDefinition> getPropositionsByType(String typeId)
                                                 throws RiceIllegalArgumentException
Retrieve Propositions of the specified type

Parameters:
typeId - type of the Propositions to be retrieved
Returns:
list of Propositions of the specified type
Throws:
RiceIllegalArgumentException - if the given typeId is null or invalid

getPropositionsByRule

Set<PropositionDefinition> getPropositionsByRule(String ruleId)
                                                 throws RiceIllegalArgumentException
Retrieve Propositions associated with the specified Rule

Parameters:
ruleId - identifier of the Rule to which the Propositions are associated with
Returns:
list of Propositions associated with the Rule
Throws:
RiceIllegalArgumentException - if the given ruleId is null or invalid

updateProposition

void updateProposition(PropositionDefinition propositionDefinition)
                       throws RiceIllegalArgumentException
Update the Proposition

Parameters:
propositionDefinition - updated data for the Proposition, id specifies the object to be updated
Throws:
RiceIllegalArgumentException - if the given propositionDefinition is null or invalid

deleteProposition

void deleteProposition(String id)
                       throws RiceIllegalArgumentException
Delete the Proposition

Parameters:
id - identifier of the Proposition to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

createNaturalLanguageUsage

NaturalLanguageUsage createNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage)
                                                throws RiceIllegalArgumentException
Create NaturalLanguageUsage

Parameters:
naturalLanguageUsage - data for the new NaturalLanguageUsage to be created
Returns:
newly created NaturalLanguageUsage
Throws:
RiceIllegalArgumentException - if the given naturalLanguageUsage is null or invalid

getNaturalLanguageUsage

NaturalLanguageUsage getNaturalLanguageUsage(String id)
                                             throws RiceIllegalArgumentException
Retrieve NaturalLanguageUsage specified by the identifier

Parameters:
id - identifier of the NaturalLanguageUsage to be retrieved
Returns:
NaturalLanguageUsage specified by the identifier
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

updateNaturalLanguageUsage

void updateNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage)
                                throws RiceIllegalArgumentException
Update NaturalLanguageUsage

Parameters:
naturalLanguageUsage - updated data for the NaturalLanguageUsage object specified by the id
Throws:
RiceIllegalArgumentException - if the given naturalLanguageUsage is null or invalid

deleteNaturalLanguageUsageType

void deleteNaturalLanguageUsageType(String naturalLanguageUsageId)
                                    throws RiceIllegalArgumentException
Delete NaturalLanguageUsage

Parameters:
naturalLanguageUsageId - identifier of the NaturalLanguageUsage to be deleted
Throws:
RiceIllegalArgumentException - if the given naturalLanguageUsageId is null or invalid

getNaturalLanguageForType

String getNaturalLanguageForType(String naturalLanguageUsageId,
                                 String typeId,
                                 String krmsObjectId,
                                 String languageCode)
                                 throws RiceIllegalArgumentException
Translates and retrieves a NaturalLanguage for a given KRMS object (e.g, proposition or agenda), NaturalLanguage usage type (context) and language into natural language TODO: Add appropriate caching annotation

Parameters:
naturalLanguageUsageId - Natural language usage information
typeId - KRMS object type id (for example, could refer to agenda or proposition)
krmsObjectId - KRMS object identifier
languageCode - desired
Returns:
natural language corresponding to the NaturalLanguage usage, KRMS object id, KRMS object type and desired language
Throws:
RiceIllegalArgumentException - if the given naturalLanguageUsageId, typeId, krmsObjectId or language is null or invalid

getNaturalLanguageUsages

Set<NaturalLanguageUsage> getNaturalLanguageUsages()
Retrieve all the NaturalLanguageUsages

Returns:
list of NaturalLanguageUsages


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.