Interface ResponsibilityService


public interface ResponsibilityService
This service provides operations for determining what responsibility actions a principal has and for querying about responsibility data. It also provides several write operations.

A responsibility represents an action that a principal is requested to take. This is used for defining workflow actions (such as approve, acknowledge, fyi) that the principal has the responsibility to take. The workflow engine integrates with this service to provide responsibility-driven routing.

A responsibility is very similar to a permission in a couple of ways. First of all, responsibilities are always granted to a role, never assigned directly to a principal or group. Furthermore, in a similar fashion to permissions, a role has the concept of a responsibility template. The responsibility template specifies what additional responsibility details need to be defined when the responsibility is created.

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

    • createResponsibility

      @CacheEvict(value={"http://rice.kuali.org/kim/v2_0/ResponsibilityType","http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}"}, allEntries=true) Responsibility createResponsibility(Responsibility responsibility) throws RiceIllegalArgumentException, RiceIllegalStateException
      This will create a Responsibility exactly like the responsibility passed in.
      Parameters:
      responsibility - the responsibility to create
      Returns:
      the id of the newly created object. will never be null.
      Throws:
      RiceIllegalArgumentException - if the responsibility is null
      RiceIllegalStateException - if the responsibility is already existing in the system
    • updateResponsibility

      @CacheEvict(value={"http://rice.kuali.org/kim/v2_0/ResponsibilityType","http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}"}, allEntries=true) Responsibility updateResponsibility(Responsibility responsibility) throws RiceIllegalArgumentException, RiceIllegalStateException
      This will up ev a Responsibility.
      Parameters:
      responsibility - the responsibility to update
      Throws:
      RiceIllegalArgumentException - if the responsibility is null
      RiceIllegalStateException - if the responsibility does not exist in the system
    • getResponsibility

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType", key="\'id=\' + #p0") Responsibility getResponsibility(String id) throws RiceIllegalArgumentException
      Gets a Responsibility from an id.

      This method will return null if the responsibility does not exist.

      Parameters:
      id - the unique id to retrieve the responsibility by. cannot be null or blank.
      Returns:
      a Responsibility or null
      Throws:
      RiceIllegalArgumentException - if the id is null or blank
    • findRespByNamespaceCodeAndName

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType", key="\'namespaceCode=\' + #p0 + \'|\' + \'name=\' + #p1") Responsibility findRespByNamespaceCodeAndName(String namespaceCode, String name) throws RiceIllegalArgumentException
      Finds a Responsibility for namespaceCode and name.
      Parameters:
      namespaceCode - the namespace code. cannot be null or blank.
      name - the responsibility name. cannot be null or blank.
      Returns:
      a Responsibility or null
      Throws:
      RiceIllegalArgumentException - if the id or namespaceCode is null or blank
    • getResponsibilityTemplate

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}", key="\'id=\' + #p0") Template getResponsibilityTemplate(String id) throws RiceIllegalArgumentException
      Gets a Template from an id.

      This method will return null if the template does not exist.

      Parameters:
      id - the unique id to retrieve the template by. cannot be null or blank.
      Returns:
      a Template or null
      Throws:
      RiceIllegalArgumentException - if the id is null or blank
    • findRespTemplateByNamespaceCodeAndName

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}", key="\'namespaceCode=\' + #p0 + \'|\' + \'name=\' + #p1") Template findRespTemplateByNamespaceCodeAndName(String namespaceCode, String name) throws RiceIllegalArgumentException
      Finds a Template for namespaceCode and name.
      Parameters:
      namespaceCode - the namespace code. cannot be null or blank.
      name - the template name. cannot be null or blank.
      Returns:
      a Template or null
      Throws:
      RiceIllegalArgumentException - if the id or namespaceCode is null or blank
    • hasResponsibility

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType", key="\'{hasResponsibility}\' + \'principalId=\' + #p0 + \'|\' + \'namespaceCode=\' + #p1 + \'|\' + \'respName=\' + #p2 + \'|\' + \'qualification=\' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).mapKey(#p3)", condition="!T(org.kuali.rice.kim.api.cache.KimCacheUtils).isResponsibilityAssignedToDynamicRole(#p1, #p2)") boolean hasResponsibility(String principalId, String namespaceCode, String respName, Map<String,String> qualification) throws RiceIllegalArgumentException
      Checks in a given principal id has a responsibility using the passed in responsibility information.
      Parameters:
      principalId - the principal id to check. cannot be null or blank.
      namespaceCode - the namespace code. cannot be null or blank.
      respName - the responsibility name. cannot be null or blank.
      qualification - the qualification for the responsibility. cannot be null.
      Returns:
      true is principal has responsibility
      Throws:
      RiceIllegalArgumentException - if the principalId, namespaceCode, respName is null or blank
      RiceIllegalArgumentException - if the qualification is null
    • hasResponsibilityByTemplate

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType", key="\'{hasResponsibilityByTemplate}\' + \'principalId=\' + #p0 + \'|\' + \'namespaceCode=\' + #p1 + \'|\' + \'respTemplateName=\' + #p2 + \'|\' + \'qualification=\' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).mapKey(#p3) + \'|\' + \'respDetails=\' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).mapKey(#p4)", condition="!T(org.kuali.rice.kim.api.cache.KimCacheUtils).isResponsibilityTemplateAssignedToDynamicRole(#p1, #p2)") boolean hasResponsibilityByTemplate(String principalId, String namespaceCode, String respTemplateName, Map<String,String> qualification, Map<String,String> respDetails) throws RiceIllegalArgumentException
      Checks in a given principal id has a responsibility using the passed in responsibility template information.
      Parameters:
      principalId - the principal id to check. cannot be null or blank.
      namespaceCode - the namespace code. cannot be null or blank.
      respTemplateName - the responsibility template name. cannot be null or blank.
      qualification - the qualification for the responsibility. cannot be null.
      respDetails - the responsibility details. cannot be null.
      Returns:
      true is principal has responsibility
      Throws:
      RiceIllegalArgumentException - if the principalId, namespaceCode, respName is null or blank
      RiceIllegalArgumentException - if the qualification or responsibilityDetails is null
    • getResponsibilityActions

      List<ResponsibilityAction> getResponsibilityActions(String namespaceCode, String respName, Map<String,String> qualification) throws RiceIllegalArgumentException
      Gets a List of ResponsibilityAction based on passed in responsibility information.
      Parameters:
      namespaceCode - the namespace code. cannot be null or blank.
      respName - the responsibility name. cannot be null or blank.
      qualification - the qualification for the responsibility. cannot be null.
      Returns:
      an immutable list of ResponsibilityAction. Will not return null.
      Throws:
      RiceIllegalArgumentException - if the namespaceCode, respName is null or blank
      RiceIllegalArgumentException - if the qualification or respDetails is null
    • getResponsibilityActionsByTemplate

      List<ResponsibilityAction> getResponsibilityActionsByTemplate(String namespaceCode, String respTemplateName, Map<String,String> qualification, Map<String,String> respDetails) throws RiceIllegalArgumentException
      Gets a List of ResponsibilityAction based on passed in responsibility template information.
      Parameters:
      namespaceCode - the namespace code. cannot be null or blank.
      respTemplateName - the responsibility name. cannot be null or blank.
      qualification - the qualification for the responsibility. cannot be null.
      respDetails - the responsibility details. can be null.
      Returns:
      an immutable list of ResponsibilityAction. Will not return null.
      Throws:
      RiceIllegalArgumentException - if the namespaceCode, respName is null or blank
      RiceIllegalArgumentException - if the qualification or respDetails is null
    • getRoleIdsForResponsibility

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType", key="\'{getRoleIdsForResponsibility}\' + \'id=\' + #p0") List<String> getRoleIdsForResponsibility(String id) throws RiceIllegalArgumentException
      Gets a List of roleIds that the responsibility is associated with.
      Parameters:
      id - the unique id to retrieve the roleIds for. cannot be null or blank.
      Returns:
      an immutable list of roleIds. Will not return null.
      Throws:
      RiceIllegalArgumentException - if the id is null or blank or if the qualification is null
    • findResponsibilities

      ResponsibilityQueryResults findResponsibilities(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
      This method find Responsibilities based on a query criteria. The criteria cannot be null.
      Parameters:
      queryByCriteria - the criteria. Cannot be null.
      Returns:
      query results. will never return null.
      Throws:
      RiceIllegalArgumentException - if the queryByCriteria is null
    • findResponsibilityTemplates

      TemplateQueryResults findResponsibilityTemplates(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException
      This method find Responsibility Templates based on a query criteria. The criteria cannot be null.
      Parameters:
      queryByCriteria - the criteria. Cannot be null.
      Returns:
      query results. will never return null.
      Throws:
      RiceIllegalArgumentException - if the queryByCriteria is null
    • findResponsibilitiesByTemplate

      @Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType", key="\'namespaceCode=\' + #p1 + \'|\' + \'templateName=\' + #p2") List<Responsibility> findResponsibilitiesByTemplate(String namespaceCode, String templateName) throws RiceIllegalArgumentException
      Return the responsibilities for the given unique combination of namespace, and responsibility template name.
      Parameters:
      namespaceCode - namespace code for permission. cannot be null or blank.
      templateName - name of permission template. cannot be null or blank.
      Returns:
      a list of Permission or null
      Throws:
      RiceIllegalArgumentException - if the namespaceCode or name is null or blank
      Since:
      2.1.1