org.kuali.rice.krms.impl.repository
Class RuleManagementServiceImpl

java.lang.Object
  extended by org.kuali.rice.krms.impl.repository.RuleRepositoryServiceImpl
      extended by org.kuali.rice.krms.impl.repository.RuleManagementServiceImpl
All Implemented Interfaces:
RuleManagementService, RuleRepositoryService, TranslateBusinessMethods

public class RuleManagementServiceImpl
extends RuleRepositoryServiceImpl
implements RuleManagementService

The implementation of RuleManagementService operations facilitate management of rules and associated information.

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

Field Summary
 
Fields inherited from class org.kuali.rice.krms.impl.repository.RuleRepositoryServiceImpl
businessObjectService
 
Constructor Summary
RuleManagementServiceImpl()
           
 
Method Summary
 ActionDefinition createAction(ActionDefinition actionDefinition)
          Create Action
 AgendaDefinition createAgenda(AgendaDefinition agendaDefinition)
          Create Agenda
 AgendaItemDefinition createAgendaItem(AgendaItemDefinition agendaItemDefinition)
          Create AgendaItem
 ContextDefinition createContext(ContextDefinition contextDefinition)
          Create Context
 NaturalLanguageTemplate createNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate)
          This will create a NaturalLanguageTemplate exactly like the parameter passed in except the id will be assigned and create date/user will be set.
 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 deleteAction(String id)
          Delete the specified Action
 void deleteAgenda(String id)
          Delete the specified Agenda
 void deleteAgendaItem(String id)
          Delete the specified AgendaItem
 void deleteContext(String id)
          Delete the specified Context
 void deleteNaturalLanguageTemplate(String naturalLanguageTemplateId)
          Delete the NaturalLanguageTemplate with the given id.
 void deleteNaturalLanguageUsage(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> findActionIds(QueryByCriteria queryByCriteria)
          Query for Action ids based on the given search criteria which is a Map of Action field names to values.
 List<String> findAgendaIds(QueryByCriteria queryByCriteria)
          Query for Agenda ids based on the given search criteria which is a Map of Agenda field names to values.
 List<String> findContextIds(QueryByCriteria queryByCriteria)
          Query for Context ids based on the given search criteria which is a Map of Context field names to values.
 ContextDefinition findCreateContext(ContextDefinition contextDefinition)
          find Create Context Searches for an existing context with the same name and namespace and returns it otherwise it creates the context.
 NaturalLanguageTemplate findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId(String languageCode, String typeId, String naturalLanguageUsageId)
           
 List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByLanguageCode(String languageCode)
          Finds all the natural language templates for a particular language
 List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByNaturalLanguageUsage(String naturalLanguageUsageId)
          Find all the natural language templates for a particular usage
 List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByTemplate(String template)
          Find the natural language template using the actual text of the template.
 List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByType(String typeId)
          Find all the natural language templates of a particular type Template types are keys that identify the message that is to be expressed in different languages and in different usage scenarios
 List<String> findPropositionIds(QueryByCriteria queryByCriteria)
          Query for Proposition ids based on the given search criteria which is a Map of Proposition field names to values.
 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
 List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceObject(String referenceObjectReferenceDiscriminatorType, String referenceObjectId)
          Retrieves list of ReferenceObjectBinding objects for the given obj discriminator type and reference object id
 List<String> findRuleIds(QueryByCriteria queryByCriteria)
          Query for Rule ids based on the given search criteria which is a Map of Rule field names to values.
 ActionDefinition getAction(String actionId)
          Retrieves the action for the given actionId.
 ActionBoService getActionBoService()
           
 List<ActionDefinition> getActions(List<String> actionIds)
          Retrieves all of the actions for the given list of actionIds.
 AgendaDefinition getAgenda(String id)
          Retrieve Agenda for the specified id
 AgendaBoService getAgendaBoService()
           
 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
 ContextDefinition getContext(String id)
          Retrieve Context for the specified id
 ContextBoService getContextBoService()
           
 ContextDefinition getContextByNameAndNamespace(String name, String namespace)
          Retrieves an Context from the repository based on the provided context name and namespace.
 NaturalLanguageTemplate getNaturalLanguageTemplate(String naturalLanguageTemplateId)
          Retrieves a NaturalLanguageTemplate from the repository based on the given id.
 NaturalLanguageTemplateBoService getNaturalLanguageTemplateBoService()
           
 NaturalLanguageUsage getNaturalLanguageUsage(String id)
          Retrieve NaturalLanguageUsage specified by the identifier
 NaturalLanguageUsageBoService getNaturalLanguageUsageBoService()
           
 NaturalLanguageUsage getNaturalLanguageUsageByNameAndNamespace(String name, String namespace)
          Retrieve NaturalLanguageUsage specified by name and namespace
 List<NaturalLanguageUsage> getNaturalLanguageUsagesByNamespace(String namespace)
          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
 PropositionDefinition getProposition(String id)
          Retrieve Proposition specified by the identifier
 PropositionBoService getPropositionBoService()
           
 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
 ReferenceObjectBindingBoService getReferenceObjectBindingBoService()
           
 List<ReferenceObjectBinding> getReferenceObjectBindings(List<String> ids)
          Retrieve list of ReferenceObjectBinding objects given ids
 RuleBoService getRuleBoService()
           
 NaturalLanguageTemplaterContract getTemplater()
           
 TermRepositoryService getTermRepositoryService()
           
 void setActionBoService(ActionBoService actionBoService)
           
 void setAgendaBoService(AgendaBoService agendaBoService)
           
 void setBusinessObjectService(BusinessObjectService businessObjectService)
          Sets the businessObjectService property.
 void setContextBoService(ContextBoService contextBoService)
           
 void setNaturalLanguageTemplateBoService(NaturalLanguageTemplateBoService naturalLanguageTemplateBoService)
           
 void setNaturalLanguageUsageBoService(NaturalLanguageUsageBoService naturalLanguageUsageBoService)
           
 void setPropositionBoService(PropositionBoService propositionBoService)
           
 void setReferenceObjectBindingBoService(ReferenceObjectBindingBoService referenceObjectBindingBoService)
           
 void setRuleBoService(RuleBoService ruleBoService)
           
 void setTemplater(NaturalLanguageTemplaterContract templater)
           
 void setTermRepositoryService(TermRepositoryService termRepositoryService)
           
 String translateNaturalLanguageForObject(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
 String translateNaturalLanguageForProposition(String naturalLanguageUsageId, PropositionDefinition proposition, String languageCode)
          Retrieve all the NaturalLanguageUsages
 NaturalLanguageTree translateNaturalLanguageTreeForProposition(String naturalLanguageUsageId, PropositionDefinition propositionDefinintion, String languageCode)
          Translates NaturalLanguage for a given proposition, returning a tree of the NaturalLanguage.
 void updateAction(ActionDefinition actionDefinition)
          Update the Action specified by the identifier in the DTO
 void updateAgenda(AgendaDefinition agendaDefinition)
          Update the Agenda specified by the identifier in the input DTO
 void updateAgendaItem(AgendaItemDefinition agendaItemDefinition)
          Update an AgendaItem
 void updateContext(ContextDefinition contextDefinition)
          Update the Context specified by the identifier in the input DTO
 void updateNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate)
          This will update an existing NaturalLanguageTemplate.
 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 class org.kuali.rice.krms.impl.repository.RuleRepositoryServiceImpl
getAgendaTree, getAgendaTrees, getBusinessObjectService, getCriteriaLookupService, getRule, getRules, selectContext, setCriteriaLookupService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krms.api.repository.RuleManagementService
getRule, getRules
 
Methods inherited from interface org.kuali.rice.krms.api.repository.RuleRepositoryService
getAgendaTree, getAgendaTrees, selectContext
 

Constructor Detail

RuleManagementServiceImpl

public RuleManagementServiceImpl()
Method Detail

getReferenceObjectBindingBoService

public ReferenceObjectBindingBoService getReferenceObjectBindingBoService()

setReferenceObjectBindingBoService

public void setReferenceObjectBindingBoService(ReferenceObjectBindingBoService referenceObjectBindingBoService)

getAgendaBoService

public AgendaBoService getAgendaBoService()

setAgendaBoService

public void setAgendaBoService(AgendaBoService agendaBoService)

getRuleBoService

public RuleBoService getRuleBoService()

setRuleBoService

public void setRuleBoService(RuleBoService ruleBoService)

getPropositionBoService

public PropositionBoService getPropositionBoService()

setPropositionBoService

public void setPropositionBoService(PropositionBoService propositionBoService)

getNaturalLanguageUsageBoService

public NaturalLanguageUsageBoService getNaturalLanguageUsageBoService()

setNaturalLanguageUsageBoService

public void setNaturalLanguageUsageBoService(NaturalLanguageUsageBoService naturalLanguageUsageBoService)

getNaturalLanguageTemplateBoService

public NaturalLanguageTemplateBoService getNaturalLanguageTemplateBoService()

setNaturalLanguageTemplateBoService

public void setNaturalLanguageTemplateBoService(NaturalLanguageTemplateBoService naturalLanguageTemplateBoService)

getContextBoService

public ContextBoService getContextBoService()

setContextBoService

public void setContextBoService(ContextBoService contextBoService)

getActionBoService

public ActionBoService getActionBoService()

setActionBoService

public void setActionBoService(ActionBoService actionBoService)

getTemplater

public NaturalLanguageTemplaterContract getTemplater()

setTemplater

public void setTemplater(NaturalLanguageTemplaterContract templater)

getTermRepositoryService

public TermRepositoryService getTermRepositoryService()

setTermRepositoryService

public void setTermRepositoryService(TermRepositoryService termRepositoryService)

createReferenceObjectBinding

public ReferenceObjectBinding createReferenceObjectBinding(ReferenceObjectBinding referenceObjectDefinition)
                                                    throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create RefObject-KRMS object binding

Specified by:
createReferenceObjectBinding in interface RuleManagementService
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

public ReferenceObjectBinding getReferenceObjectBinding(String id)
                                                 throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve referenceObjectBinding given a specific id

Specified by:
getReferenceObjectBinding in interface RuleManagementService
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

public List<ReferenceObjectBinding> getReferenceObjectBindings(List<String> ids)
                                                        throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve list of ReferenceObjectBinding objects given ids

Specified by:
getReferenceObjectBindings in interface RuleManagementService
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

findReferenceObjectBindingsByReferenceObject

public List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceObject(String referenceObjectReferenceDiscriminatorType,
                                                                                 String referenceObjectId)
                                                                          throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieves list of ReferenceObjectBinding objects for the given obj discriminator type and reference object id

Specified by:
findReferenceObjectBindingsByReferenceObject in interface RuleManagementService
Parameters:
referenceObjectReferenceDiscriminatorType - reference object type
referenceObjectId - reference object id
Returns:
list of ReferenceObjectBinding objects for the given discriminator type
Throws:
RiceIllegalArgumentException - if the given referenceObjectKrmsDiscriminatorType or id is blank or invalid

findReferenceObjectBindingsByReferenceDiscriminatorType

public List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceDiscriminatorType(String referenceObjectReferenceDiscriminatorType)
                                                                                     throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieves list of ReferenceObjectBinding objects for the given ref obj discriminator type

Specified by:
findReferenceObjectBindingsByReferenceDiscriminatorType in interface RuleManagementService
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

public List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsDiscriminatorType(String referenceObjectKrmsDiscriminatorType)
                                                                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieves list of ReferenceObjectBinding objects for the given krms obj discriminator type

Specified by:
findReferenceObjectBindingsByKrmsDiscriminatorType in interface RuleManagementService
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

public List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsObject(String krmsObjectId)
                                                                     throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieves list of ReferenceObjectBinding objects for the given KRMS obj id.

Specified by:
findReferenceObjectBindingsByKrmsObject in interface RuleManagementService
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

public void updateReferenceObjectBinding(ReferenceObjectBinding referenceObjectBindingDefinition)
                                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update the ReferenceObjectBinding object specified by the identifier in the given DTO

Specified by:
updateReferenceObjectBinding in interface RuleManagementService
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

public void deleteReferenceObjectBinding(String id)
                                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the specified ReferenceObjectBinding object

Specified by:
deleteReferenceObjectBinding in interface RuleManagementService
Parameters:
id - identifier of the object to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

findReferenceObjectBindingIds

public List<String> findReferenceObjectBindingIds(QueryByCriteria queryByCriteria)
                                           throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
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.

Specified by:
findReferenceObjectBindingIds in interface RuleManagementService
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

public AgendaDefinition createAgenda(AgendaDefinition agendaDefinition)
                              throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create Agenda

Specified by:
createAgenda in interface RuleManagementService
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

public AgendaDefinition getAgenda(String id)
                           throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Agenda for the specified id

Specified by:
getAgenda in interface RuleManagementService
Parameters:
id - identifier for the Agenda
Returns:
specified Agenda
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getAgendasByContext

public List<AgendaDefinition> getAgendasByContext(String contextId)
                                           throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Agendas associated with the specified context

Specified by:
getAgendasByContext in interface RuleManagementService
Parameters:
contextId - context of interest
Returns:
list of Agendas associated with the context
Throws:
RiceIllegalArgumentException - if the given contextId is null or invalid

updateAgenda

public void updateAgenda(AgendaDefinition agendaDefinition)
                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update the Agenda specified by the identifier in the input DTO

Specified by:
updateAgenda in interface RuleManagementService
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

public void deleteAgenda(String id)
                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the specified Agenda

Specified by:
deleteAgenda in interface RuleManagementService
Parameters:
id - identifier of the object to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getAgendasByType

public List<AgendaDefinition> getAgendasByType(String typeId)
                                        throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Agendas of the specified type

Specified by:
getAgendasByType in interface RuleManagementService
Parameters:
typeId - type of the Agenda
Returns:
list of Agendas of the specified type
Throws:
RiceIllegalArgumentException - if the given typeId is null or invalid

getAgendasByTypeAndContext

public List<AgendaDefinition> getAgendasByTypeAndContext(String typeId,
                                                         String contextId)
                                                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Agendas of the specified type and context

Specified by:
getAgendasByTypeAndContext in interface RuleManagementService
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

createAgendaItem

public AgendaItemDefinition createAgendaItem(AgendaItemDefinition agendaItemDefinition)
                                      throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create AgendaItem

Specified by:
createAgendaItem in interface RuleManagementService
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

public AgendaItemDefinition getAgendaItem(String id)
                                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve AgendaItem by the specified identifier

Specified by:
getAgendaItem in interface RuleManagementService
Parameters:
id - identifier of the AgendaItem
Returns:
AgendaItem specified by the identifier
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getAgendaItemsByType

public List<AgendaItemDefinition> getAgendaItemsByType(String typeId)
                                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve AgendaItems by specified type

Specified by:
getAgendaItemsByType in interface RuleManagementService
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

public List<AgendaItemDefinition> getAgendaItemsByContext(String contextId)
                                                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve AgendaItems associated with a context

Specified by:
getAgendaItemsByContext in interface RuleManagementService
Parameters:
contextId - context identifier
Returns:
list of AgendaItems associated with a context
Throws:
RiceIllegalArgumentException - if the given contextId is null or invalid

getAgendaItemsByTypeAndContext

public List<AgendaItemDefinition> getAgendaItemsByTypeAndContext(String typeId,
                                                                 String contextId)
                                                          throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve AgendaItems by type and context

Specified by:
getAgendaItemsByTypeAndContext in interface RuleManagementService
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

deleteAgendaItem

public void deleteAgendaItem(String id)
                      throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the specified AgendaItem

Specified by:
deleteAgendaItem in interface RuleManagementService
Parameters:
id - identifier of the AgendaItem to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

updateAgendaItem

public void updateAgendaItem(AgendaItemDefinition agendaItemDefinition)
                      throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update an AgendaItem

Specified by:
updateAgendaItem in interface RuleManagementService
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

createRule

public RuleDefinition createRule(RuleDefinition ruleDefinition)
                          throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create Rule

Specified by:
createRule in interface RuleManagementService
Parameters:
ruleDefinition - data for the new Rule to be created
Returns:
newly created Rule
Throws:
RiceIllegalArgumentException - if the given ruleDefinition is null or invalid

updateRule

public void updateRule(RuleDefinition ruleDefinition)
                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update the Rule specified by the identifier in the DTO

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

deleteRule

public void deleteRule(String id)
                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the specified Rule

Specified by:
deleteRule in interface RuleManagementService
Parameters:
id - identifier of the Rule to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

createAction

public ActionDefinition createAction(ActionDefinition actionDefinition)
                              throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create Action

Specified by:
createAction in interface RuleManagementService
Parameters:
actionDefinition - data for the new Action to be created
Returns:
newly created Action
Throws:
RiceIllegalArgumentException - if the given actionDefinition is null or invalid

updateAction

public void updateAction(ActionDefinition actionDefinition)
                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update the Action specified by the identifier in the DTO

Specified by:
updateAction in interface RuleManagementService
Parameters:
actionDefinition - updated Action information, object specified by the id
Throws:
RiceIllegalArgumentException - if the given actionDefinition is null or invalid

deleteAction

public void deleteAction(String id)
                  throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the specified Action

Specified by:
deleteAction in interface RuleManagementService
Parameters:
id - identifier of the Action to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getAction

public ActionDefinition getAction(String actionId)
Description copied from interface: RuleManagementService
Retrieves the action for the given actionId. The action includes the propositions which define the condition that is to be evaluated on the action. It also defines a collection of actions which will be invoked if the action succeeds.

Specified by:
getAction in interface RuleManagementService
Parameters:
actionId - the id of the action to retrieve
Returns:
the action definition, or null if no action could be located for the given actionId

getActions

public List<ActionDefinition> getActions(List<String> actionIds)
Description copied from interface: RuleManagementService
Retrieves all of the actions for the given list of actionIds.

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 action doesn't exist for a given action 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:
getActions in interface RuleManagementService
Parameters:
actionIds - the list of action ids for which to retrieve the actions
Returns:
the list of actions for the given ids, this list will only contain actions for the ids that were resolved successfully, it will never return null but could return an empty list if no actions could be loaded for the given set of ids

createProposition

public PropositionDefinition createProposition(PropositionDefinition propositionDefinition)
                                        throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create a Proposition

Specified by:
createProposition in interface RuleManagementService
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

public PropositionDefinition getProposition(String id)
                                     throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Proposition specified by the identifier

Specified by:
getProposition in interface RuleManagementService
Parameters:
id - identifier of the Proposition to be retrieved
Returns:
specified Proposition
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getPropositionsByType

public Set<PropositionDefinition> getPropositionsByType(String typeId)
                                                 throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Propositions of the specified type

Specified by:
getPropositionsByType in interface RuleManagementService
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

public Set<PropositionDefinition> getPropositionsByRule(String ruleId)
                                                 throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Propositions associated with the specified Rule

Specified by:
getPropositionsByRule in interface RuleManagementService
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

public void updateProposition(PropositionDefinition propositionDefinition)
                       throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update the Proposition

Specified by:
updateProposition in interface RuleManagementService
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

public void deleteProposition(String id)
                       throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the Proposition

Specified by:
deleteProposition in interface RuleManagementService
Parameters:
id - identifier of the Proposition to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

createNaturalLanguageUsage

public NaturalLanguageUsage createNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage)
                                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create NaturalLanguageUsage

Specified by:
createNaturalLanguageUsage in interface RuleManagementService
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

public NaturalLanguageUsage getNaturalLanguageUsage(String id)
                                             throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve NaturalLanguageUsage specified by the identifier

Specified by:
getNaturalLanguageUsage in interface RuleManagementService
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

public void updateNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage)
                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update NaturalLanguageUsage

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

deleteNaturalLanguageUsage

public void deleteNaturalLanguageUsage(String naturalLanguageUsageId)
                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete NaturalLanguageUsage

Specified by:
deleteNaturalLanguageUsage in interface RuleManagementService
Parameters:
naturalLanguageUsageId - identifier of the NaturalLanguageUsage to be deleted
Throws:
RiceIllegalArgumentException - if the given naturalLanguageUsageId is null or invalid

getNaturalLanguageUsagesByNamespace

public List<NaturalLanguageUsage> getNaturalLanguageUsagesByNamespace(String namespace)
                                                               throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
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

Specified by:
getNaturalLanguageUsagesByNamespace in interface RuleManagementService
Parameters:
namespace - namespace to search on.
Returns:
list of NaturalLanguageUsages in a particular namespace
Throws:
RiceIllegalArgumentException

getNaturalLanguageUsageByNameAndNamespace

public NaturalLanguageUsage getNaturalLanguageUsageByNameAndNamespace(String name,
                                                                      String namespace)
                                                               throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve NaturalLanguageUsage specified by name and namespace

Specified by:
getNaturalLanguageUsageByNameAndNamespace in interface RuleManagementService
Parameters:
name - the name of the natural language usage to retrieve.
namespace - the namespace that the natural language usage is under.
Returns:
an NaturalLanguageUsage identified by the given name and namespace. A null reference is returned if an invalid or non-existent name and namespace combination is supplied.
Throws:
RiceIllegalArgumentException - if the either the name or the namespace is null or blank.

translateNaturalLanguageForObject

public String translateNaturalLanguageForObject(String naturalLanguageUsageId,
                                                String typeId,
                                                String krmsObjectId,
                                                String languageCode)
                                         throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
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

Specified by:
translateNaturalLanguageForObject in interface RuleManagementService
Specified by:
translateNaturalLanguageForObject in interface TranslateBusinessMethods
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

translateNaturalLanguageForProposition

public String translateNaturalLanguageForProposition(String naturalLanguageUsageId,
                                                     PropositionDefinition proposition,
                                                     String languageCode)
                                              throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve all the NaturalLanguageUsages

Specified by:
translateNaturalLanguageForProposition in interface RuleManagementService
Specified by:
translateNaturalLanguageForProposition in interface TranslateBusinessMethods
Returns:
list of NaturalLanguageUsages
Throws:
RiceIllegalArgumentException

translateNaturalLanguageTreeForProposition

public NaturalLanguageTree translateNaturalLanguageTreeForProposition(String naturalLanguageUsageId,
                                                                      PropositionDefinition propositionDefinintion,
                                                                      String languageCode)
                                                               throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Translates NaturalLanguage for a given proposition, returning a tree of the NaturalLanguage. This method is used to "preview" the proposition in a tree structure before saving.

Specified by:
translateNaturalLanguageTreeForProposition in interface RuleManagementService
Specified by:
translateNaturalLanguageTreeForProposition in interface TranslateBusinessMethods
Parameters:
naturalLanguageUsageId - Natural language usage information
propositionDefinintion - proposition to be translated
languageCode - desired
Returns:
natural language tree corresponding to the NaturalLanguage usage, proposition and desired language
Throws:
RiceIllegalArgumentException - if the given naturalLanguageUsageId, proposition, or language is null or invalid

createContext

public ContextDefinition createContext(ContextDefinition contextDefinition)
                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Create Context

Specified by:
createContext in interface RuleManagementService
Parameters:
contextDefinition - data for the new Context to be created
Returns:
newly created Context
Throws:
RiceIllegalArgumentException - if the given contextDefinition is null or invalid or already in use.

findCreateContext

public ContextDefinition findCreateContext(ContextDefinition contextDefinition)
                                    throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
find Create Context Searches for an existing context with the same name and namespace and returns it otherwise it creates the context.

Specified by:
findCreateContext in interface RuleManagementService
Parameters:
contextDefinition - data for the new Context to be created
Returns:
newly created Context
Throws:
RiceIllegalArgumentException - if the given contextDefinition is null or invalid

updateContext

public void updateContext(ContextDefinition contextDefinition)
                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Update the Context specified by the identifier in the input DTO

Specified by:
updateContext in interface RuleManagementService
Parameters:
contextDefinition - DTO with updated info and identifier of the object to be updated
Throws:
RiceIllegalArgumentException - if the given contextDefinition is null or invalid

deleteContext

public void deleteContext(String id)
                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the specified Context

Specified by:
deleteContext in interface RuleManagementService
Parameters:
id - identifier of the object to be deleted
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getContext

public ContextDefinition getContext(String id)
                             throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieve Context for the specified id

Specified by:
getContext in interface RuleManagementService
Parameters:
id - identifier for the Context
Returns:
specified Context
Throws:
RiceIllegalArgumentException - if the given id is null or invalid

getContextByNameAndNamespace

public ContextDefinition getContextByNameAndNamespace(String name,
                                                      String namespace)
                                               throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieves an Context from the repository based on the provided context name and namespace.

Specified by:
getContextByNameAndNamespace in interface RuleManagementService
Parameters:
name - the name of the Context to retrieve.
namespace - the namespace that the context is under.
Returns:
an ContextDefinition identified by the given name and namespace. A null reference is returned if an invalid or non-existent name and namespace combination is supplied.
Throws:
RiceIllegalArgumentException - if the either the name or the namespace is null or blank.

createNaturalLanguageTemplate

public NaturalLanguageTemplate createNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate)
                                                      throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
This will create a NaturalLanguageTemplate exactly like the parameter passed in except the id will be assigned and create date/user will be set.

Specified by:
createNaturalLanguageTemplate in interface RuleManagementService
Parameters:
naturalLanguageTemplate - The NaturalLanguageTemplate to create.
Returns:
a NaturalLanguageTemplate exactly like the parameter passed in.
Throws:
RiceIllegalArgumentException - if the NaturalLanguageTemplate is null.

getNaturalLanguageTemplate

public NaturalLanguageTemplate getNaturalLanguageTemplate(String naturalLanguageTemplateId)
                                                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Retrieves a NaturalLanguageTemplate from the repository based on the given id.

Specified by:
getNaturalLanguageTemplate in interface RuleManagementService
Parameters:
naturalLanguageTemplateId - to retrieve.
Returns:
a NaturalLanguageTemplate identified by the given id.
Throws:
RiceIllegalArgumentException

updateNaturalLanguageTemplate

public void updateNaturalLanguageTemplate(NaturalLanguageTemplate naturalLanguageTemplate)
                                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
This will update an existing NaturalLanguageTemplate.

Specified by:
updateNaturalLanguageTemplate in interface RuleManagementService
Parameters:
naturalLanguageTemplate - The NaturalLanguageTemplate to update.
Throws:
RiceIllegalArgumentException - if the NaturalLanguageTemplate is null. exists in the system.

deleteNaturalLanguageTemplate

public void deleteNaturalLanguageTemplate(String naturalLanguageTemplateId)
                                   throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Delete the NaturalLanguageTemplate with the given id.

Specified by:
deleteNaturalLanguageTemplate in interface RuleManagementService
Parameters:
naturalLanguageTemplateId - to delete.
Throws:
RiceIllegalArgumentException - if the NaturalLanguageTemplate is null.

findNaturalLanguageTemplatesByLanguageCode

public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByLanguageCode(String languageCode)
                                                                         throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Finds all the natural language templates for a particular language

Specified by:
findNaturalLanguageTemplatesByLanguageCode in interface RuleManagementService
Parameters:
languageCode - language on which to search
Returns:
list of templates for that language
Throws:
RiceIllegalArgumentException

findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId

public NaturalLanguageTemplate findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId(String languageCode,
                                                                                       String typeId,
                                                                                       String naturalLanguageUsageId)
                                                                                throws RiceIllegalArgumentException
Specified by:
findNaturalLanguageTemplateByLanguageCodeTypeIdAndNluId in interface RuleManagementService
Throws:
RiceIllegalArgumentException

findNaturalLanguageTemplatesByNaturalLanguageUsage

public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByNaturalLanguageUsage(String naturalLanguageUsageId)
                                                                                 throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Find all the natural language templates for a particular usage

Specified by:
findNaturalLanguageTemplatesByNaturalLanguageUsage in interface RuleManagementService
Parameters:
naturalLanguageUsageId - the usage on which to search
Returns:
list of templates that match the usage
Throws:
RiceIllegalArgumentException

findNaturalLanguageTemplatesByType

public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByType(String typeId)
                                                                 throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Find all the natural language templates of a particular type Template types are keys that identify the message that is to be expressed in different languages and in different usage scenarios

Specified by:
findNaturalLanguageTemplatesByType in interface RuleManagementService
Parameters:
typeId - on which to search
Returns:
list of templates matching that type
Throws:
RiceIllegalArgumentException

findNaturalLanguageTemplatesByTemplate

public List<NaturalLanguageTemplate> findNaturalLanguageTemplatesByTemplate(String template)
                                                                     throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Find the natural language template using the actual text of the template.

Specified by:
findNaturalLanguageTemplatesByTemplate in interface RuleManagementService
Parameters:
template - text to match exactly
Returns:
list of matching templates
Throws:
RiceIllegalArgumentException

findContextIds

public List<String> findContextIds(QueryByCriteria queryByCriteria)
                            throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Query for Context ids based on the given search criteria which is a Map of Context field names to values.

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

Specified by:
findContextIds in interface RuleManagementService
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

findAgendaIds

public List<String> findAgendaIds(QueryByCriteria queryByCriteria)
                           throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Query for Agenda ids based on the given search criteria which is a Map of Agenda field names to values.

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

Specified by:
findAgendaIds in interface RuleManagementService
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

findRuleIds

public List<String> findRuleIds(QueryByCriteria queryByCriteria)
                         throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Query for Rule ids based on the given search criteria which is a Map of Rule field names to values.

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

Specified by:
findRuleIds in interface RuleManagementService
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

findPropositionIds

public List<String> findPropositionIds(QueryByCriteria queryByCriteria)
                                throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Query for Proposition ids based on the given search criteria which is a Map of Proposition field names to values.

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

Specified by:
findPropositionIds in interface RuleManagementService
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

findActionIds

public List<String> findActionIds(QueryByCriteria queryByCriteria)
                           throws RiceIllegalArgumentException
Description copied from interface: RuleManagementService
Query for Action ids based on the given search criteria which is a Map of Action field names to values.

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

Specified by:
findActionIds in interface RuleManagementService
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

setBusinessObjectService

public void setBusinessObjectService(BusinessObjectService businessObjectService)
Sets the businessObjectService property.

Overrides:
setBusinessObjectService in class RuleRepositoryServiceImpl
Parameters:
businessObjectService - The businessObjectService to set.


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