Interface RequestService


public interface RequestService
Request Service is used for managing requests and its related operations . This service allows
  • Submit,Validate,Search,Close,Withdraw requests
  • Search for request types and datasets
  • Get request History details
  • Get request count raised by/For an User

Below is the code snippet that shows how to get an instance of this service:
//returns an Request service instance
RequestService reqsrvc = Platform.getService(RequestService.class);

  • Method Details

    • submitRequest

      Submit a request for an authenticated user. Once the target entities and beneficiaries are added, this API should be called. Call to this API initiates the approvals required, if any
      Parameters:
      requestData - an instance of requestData
      Throws:
      InvalidRequestException - if requestData does not have either Target entity or Beneficiary details as per request Model definition
      RequestServiceException - if the authentication or data validation fails
      InvalidRequestDataException - if request data validation fails
      BulkBeneficiariesAddException
      BulkEntitiesAddException
    • validateRequestData

      void validateRequestData(RequestData requestData) throws InvalidRequestDataException, RequestServiceException
      Validates the request data against the data set and data set validator plug-in, if any.
      Parameters:
      requestData - request data that needs to be validated
      Throws:
      InvalidRequestDataException - if request data validation fails
      RequestServiceException - if the authentication or data validation fails
    • getTemplateNames

      @Deprecated List<String> getTemplateNames() throws RequestServiceException
      Deprecated.
      Returns the list of request template names that are available for logged in user for request creation.
      Returns:
      List of all request template names
      Throws:
      RequestServiceException - if it fails to get corresponding request model configurations
    • getRequestDataSet

      @Deprecated RequestDataSet getRequestDataSet(String requestModel, String entityType) throws RequestServiceException
      Deprecated.
      Gets the request data set associated with the given request model. This API doesn't work for the entitlement request types. For the entitlement request types, getRequestDataSet(RequestBeneficiaryEntity) needs to be used.
      Parameters:
      requestModel - Request model name.
      entityType - resource name for resource based request model/type,otherwise null.
      Returns:
      RequestDataSet Request data set object
      Throws:
      RequestServiceException - if fails to get the request data from repository
    • getRequestDataSet

      RequestDataSet getRequestDataSet(RequestEntity entity) throws RequestServiceException
      Gets the request data set associated with the given request entity object.
      Parameters:
      entity - request entity object with entity type, operation and entity key set.
      Returns:
      RequestDataSet Request data set object
      Throws:
      RequestServiceException - if fails to get the request data from repository
    • getRequestDataSet

      Gets the request data set associated with the given request entity object.
      Parameters:
      entity - request entity object with entity type, operation and entity key set.
      Returns:
      RequestDataSet Request data set object
      Throws:
      RequestServiceException - if fails to get the request data from repository
    • getRequestDataSetName

      @Deprecated String getRequestDataSetName(String requestType, String entitySubType) throws RequestServiceException
      Deprecated.
      Gets the request dataset name associated with the given request type and entity-sub-type. This API doesn't work for the entitlement request types. For the entitlement request types, getRequestDataSetName(RequestBeneficiaryEntity) needs to be used.
      Parameters:
      requestType - Name of the Request type.
      entitySubType - resource name for resource based request types, otherwise null.
      Returns:
      Request dataset name
      Throws:
      RequestServiceException - if fails to get the dataset name
    • getRequestDataSetName

      String getRequestDataSetName(RequestEntity entity) throws RequestServiceException
      Gets the request dataset name associated with the given request entity object.
      Parameters:
      entity - request entity object with entity type, operation and entity key set.
      Returns:
      Request dataset name
      Throws:
      RequestServiceException - if fails to get the dataset name
    • getRequestDataSetName

      String getRequestDataSetName(RequestBeneficiaryEntity entity) throws RequestServiceException
      Gets the request dataset name associated with the given request entity object.
      Parameters:
      entity - request entity object with entity type, operation and entity key set.
      Returns:
      Request dataset name
      Throws:
      RequestServiceException - if fails to get the dataset name
    • getBasicRequestData

      Gets the complete request details for the specified request Id. A request has following details
      • Request model/type
      • Justification
      • Status
      • Stage id
      • Request id
      • Parent request
      • List of child requests
      • List of target entity details, if request type is for Target Entities
      • List of beneficiary details, if request type allows beneficiaries
      • Request Key
      • Requester Key
      • Creation date
      • parent request flag
      • Orchestration id
      • Context id
      • Event id
      • Beneficiary Type, if request type allows beneficiaries
      • Completed date
      The information is returned only if the login user is either
      • Requester, Creator of the request
      • Beneficiary, User is a beneficiary
      • Task Assignee, Assignee of the tasks that are part of the request
      • Request Administrators
      Parameters:
      reqId - Request Id
      Returns:
      request instance
      Throws:
      RequestServiceException - if fails to get request object from repository
      NoRequestPermissionException - if the login user does not have access to the request
    • search

      List<Request> search(RequestSearchCriteria searchCriteria, Set<String> retAttrs, HashMap<String,Object> configParams) throws RequestServiceException
      Gets the the requests that match the specified search criteria. This API takes permissions into consideration and only Request Administrators can search for requests.
      Parameters:
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      retAttrs - Request data which will be returned in Request Object. If the retAttrs is null or empty Set whole request data is returned in Request object.
      configParams - Additional configuration parameters for search results
      Returns:
      List of requests. The returned Request Objects contains request data mentioned in retAttrs. If retAttrs is null or empty Request Object contains the complete request data.
      Throws:
      RequestServiceException - if login user has no search permission or if fails to retrieve the requests from the repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates an search criteria with condition - where request user id equals "jdoe"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.OR);
      searchCriteria.addExpression(RequestConstants.REQUESTER_USERID, "jdoe", RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      List<Request> requests = reqsrvc.search(searchCriteria,config)
      ......
      ......

    • getModel

      RequestModel getModel(String modelName) throws RequestServiceException
      Gets the Request Model object for the specified model name
      Parameters:
      modelName - Request model name
      Returns:
      instance of RequestModel, if model exists
      null otherwise
      Throws:
      RequestServiceException - if fails to retrieve the specified request model details from the repository
    • getRequestModel

      RequestModel getRequestModel(String entityType, String operation) throws RequestServiceException
      Gets the Request Model object associated with given entity type and operation
      Parameters:
      modelName - Request model name
      Returns:
      instance of RequestModel, if model exists
      null otherwise
      Throws:
      RequestServiceException - if fails to retrieve the specified request model details from the repository
    • getModelForTemplate

      @Deprecated RequestModel getModelForTemplate(String templateName) throws RequestServiceException
      Deprecated.
      Gets the request model associated with the request template with name specified
      Parameters:
      templateName - Request template name
      Returns:
      Request model
      Throws:
      RequestServiceException - if fails to retrieve request model details
    • getRestrictedDataSet

      @Deprecated RequestDataSet getRestrictedDataSet(String templateName, String entityType) throws RequestServiceException
      Deprecated.
      Gets the restricted data set associated with specified request template name and request entity name. Returned dataset does not contain restricted attributes with property like approver-only, system-type set to true.
      Parameters:
      templateName - Request template name
      entityType - entity name for generic entities, null otherwise.
      Returns:
      Request data set without restricted attributes
      Throws:
      RequestServiceException - if fails to retrieve specified request template or request dataset details
    • getRequestHistory

      List<RequestHistory> getRequestHistory(String reqId) throws RequestServiceException
      Gets all the request history instances for the specified request id
      Parameters:
      reqId - request id
      Returns:
      List of Request History instances
      Throws:
      RequestServiceException - if fails to retrieve the request history instances from repository
    • prePopulate

      Serializable prePopulate(String attribute, RequestDataSet dataset, RequestData data) throws RequestServiceException
      Used during Request Creation to get the value to be pre-populated for a non-child dataset attribute, if it is configured with a PrePopulationAdapter in the dataset.
      Parameters:
      attribute - Attribute for which the value is needed for pre-population
      dataset - Request Dataset
      data - RequestData object
      Returns:
      value to be pre-populated
      null if no Pre-population adapter is present.
      Throws:
      RequestServiceException - if Pre-population fails
    • prePopulate

      RequestEntity prePopulate(RequestEntity rEntity, RequestDataSet dataset, RequestData data) throws RequestServiceException
      Used during Request Creation to get the value to be pre-populated for the attributes configured to be prepopulated
      Parameters:
      rEntity - RequestEntity for which the data has to be populated.
      dataset - Request Dataset
      data - RequestData object
      Returns:
      value to be pre-populated
      null if no Pre-population adapter is present.
      Throws:
      RequestServiceException - if Pre-population fails
    • prePopulate

      Used during Request Creation to get the value to be pre-populated for the attributes configured to be prepopulated
      Parameters:
      rbEntity - RequestBeneficiaryEntity for which the data has to be populated.
      dataset - Request Dataset
      data - RequestData object
      Returns:
      value to be pre-populated
      null if no Pre-population adapter is present.
      Throws:
      RequestServiceException - if Pre-population fails
    • prePopulate

      Serializable prePopulate(String attribute, String parentAttribute, RequestDataSet dataset, RequestData data) throws RequestServiceException
      Used during Request Creation to get the value to be pre-populated for a child dataset attribute, if it is configured with a PrePopulationAdapter in the dataset.
      Parameters:
      attribute - Attribute for which the value is needed for pre-population
      parentAttribute - Parent attribute of the attribute to be pre-populated
      dataset - Request Dataset
      data - RequestData object
      Returns:
      value to be pre-populated
      null if no Pre-population adapter is present.
      Throws:
      RequestServiceException - if Pre-population fails
    • getModelNames

      List<String> getModelNames() throws RequestServiceException
      Gets all the non-deprecated request model names available in the system
      Returns:
      List of request model names
      Throws:
      RequestServiceException - if fails to retrieve the request models from the repository
    • getAllModelNames

      List<String> getAllModelNames() throws RequestServiceException
      Gets all the request model names available in the system
      Returns:
      List of request model names
      Throws:
      RequestServiceException - if fails to retrieve the request models from the repository
    • getModelNames

      List<String> getModelNames(String pattern) throws RequestServiceException
      Gets all the request model names that matches the specified search pattern. It supports search pattern with "*" as wild character. Passing null or "" does wild card search with "*".
      Parameters:
      pattern - - search pattern with "*" as wild character
      Returns:
      List of request model names.
      Throws:
      RequestServiceException - if fails to retrieve request models from the repository
    • getNumberOfRequestsCreatedByUser

      long getNumberOfRequestsCreatedByUser(long userKey, RequestSearchCriteria searchCriteria) throws RequestServiceException
      Gets the number of requests raised by user that match the specified search criteria.
      Parameters:
      userKey - Key of the user by whom requests are raised
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      Returns:
      Number of requests matched the given search criteria
      Throws:
      RequestServiceException - if login user has no search permission or if fails to retrieve the requests from the repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      Long numberOfRequests = reqsrvc.getNumberOfRequestsCreatedByUser(userKey,searchCriteria)

    • getNumberOfRequestsCreatedForUser

      long getNumberOfRequestsCreatedForUser(long userKey, RequestSearchCriteria searchCriteria) throws RequestServiceException
      Gets the number of requests raised for the specified user that match the search criteria.
      Parameters:
      userKey - Key of the user for whom requests are raised
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      Returns:
      Number of requests matched the given search criteria
      Throws:
      RequestServiceException - if the login user has no search permission or if fails to retrieve the requests from the repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      Long numberOfRequests = reqsrvc.getNumberOfRequestsCreatedForUser(userKey,searchCriteria)

    • getChildRequests

      Gets List of child requests for the specified request Id. Child requests information is returned only if the login user is either
      • Requester, Creator of the request
      • Beneficiary, User is a beneficiary
      • Task Assignee, Assignee of the tasks that are part of the request
      • Request Administrators
      Parameters:
      reqId - Parent request Id
      Returns:
      List of request
      Throws:
      RequestServiceException - if the specified request id is invalid or fails to retrieve the request details from the repository
      NoRequestPermissionException - if the login user doesn't have permissions over the request
    • getTemplate

      @Deprecated RequestTemplate getTemplate(String templateName) throws RequestServiceException
      Deprecated.
      Gets the request template instance for the specified template name. Request Template is returned only if logged in user has the permission to create request using template.
      Parameters:
      templateName - Request template name
      Returns:
      Request template object instance
      Throws:
      RequestServiceException - if fails to retrieve the request template details from the repository
    • getRequestStatusSummary

      RequestStatusSummary[] getRequestStatusSummary(String reqId) throws RequestServiceException
      Gets the status changes of the specified request.
      Parameters:
      reqId - request id
      Returns:
      An array of RequestStatusSummary value objects.
      This value object contains the status, date and time at which request achieved this status and the date and time at which the request is submitted. Current status of the request is at the first element of array
      Throws:
      RequestServiceException - if fails to retrieve the request summary details from the repository
    • getSearchResultCount

      long getSearchResultCount(RequestSearchCriteria searchCriteria) throws RequestServiceException
      Gets the count of requests that match the specified search criteria. This API takes permissions into consideration and only Request Administrators can search for requests.
      Parameters:
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      Returns:
      Number of requests matched the given search criteria
      Throws:
      RequestServiceException - if the login user has no search permission or if fails to retrieve the requests from the repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      Long numberOfRequests = reqsrvc.getSearchResultCount(searchCriteria)

    • addRequestComment

      void addRequestComment(String reqId, oracle.iam.request.vo.RequestComment comment) throws RequestServiceException
      Deprecated.
      Human task comments feature in SOA needs to be used as replacement for request comments.
      Adds a comment to the specified request.

      Only authorized users can add request comments. Authorized users are

      • Requester, Creator of the request
      • Beneficiary, Beneficiary or Target user
      • Task Assignee, Assignee of the tasks that are part of the request
      • Request Administrators

      Parameters:
      reqId - request id
      comment - Request comment value object
      Throws:
      RequestServiceException - if the login user has no search permission or fails to add comments to the specified requests
    • getRequestComments

      List<oracle.iam.request.vo.RequestComment> getRequestComments(String reqId) throws RequestServiceException
      Deprecated.
      Human task comments feature in SOA needs to be used as replacement for request comments.
      Get all the comments available for the specified request.

      Only authorized users can get request comments. Authorized users are

      • Requester, Creator of the request
      • Beneficiary, Beneficiary or Target user
      • Task Assignee, Assignee of the tasks that are part of the request
      • Request Administrators

      Parameters:
      reqId - Request ID
      Returns:
      List of request comments with latest as the first element
      Throws:
      RequestServiceException - the login user is not authorized or fails to retrieve the comments from repository
    • getRequestComments

      List<oracle.iam.request.vo.RequestComment> getRequestComments(String reqId, oracle.iam.request.vo.RequestComment.TYPE type) throws RequestServiceException
      Deprecated.
      Human task comments feature in SOA needs to be used as replacement for request comments.
      Get all the comments provided for the specified request and comment type.

      Only authorized users can get request comments. Authorized users are

      • Requester, Creator of the request
      • Beneficiary, Request Target user
      • Task Assignee, Assignee of the tasks that are part of the request
      • Request Administrators

      Parameters:
      reqId - Request Id
      type - Request comment type
      Returns:
      List of request comments with latest as the first element
      Throws:
      RequestServiceException - the login user is not authorized or fails to retrieve the comments from repository
    • getRequestComments

      List<oracle.iam.request.vo.RequestComment> getRequestComments(String reqId, String taskId, oracle.iam.request.vo.RequestComment.TYPE type) throws RequestServiceException
      Deprecated.
      Human task comments feature in SOA needs to be used as replacement for request comments.
      Gets the comments provided for the specified request,comment type and taskid.

      Only authorized users can get request comments. Authorized users are

      • Requester, Creator of the request
      • Beneficiary, Beneficiary or Target user
      • Task Assignee, Assignee of the tasks that are part of the request
      • Request Administrators

      Parameters:
      reqId - Request Id
      taskId - Task Id
      type - Request comment type
      Returns:
      List of request comments with latest as the first element
      Throws:
      RequestServiceException - the login user is not authorized or fails to retrieve the comments from repository
    • withdrawRequest

      void withdrawRequest(String reqId) throws RequestServiceException, AccessDeniedException
      Withdraws the specified request. If the request is withdrawn successfully,all the pending approvals are also withdrawn. Only requester can withdraw a request.
      Parameters:
      reqId - request Id
      Throws:
      RequestServiceException - if fails to withdraw the request
      AccessDeniedException
    • closeRequest

      void closeRequest(String reqId) throws RequestServiceException, AccessDeniedException
      Closes the specified request. If the request is closed successfully,all the pending approvals are withdrawn.
      Only Request Administrators can close a request
      Parameters:
      reqId - request Id
      Throws:
      RequestServiceException - if fails to close the request
      AccessDeniedException
    • getRequestsRaisedForMe

      List<Request> getRequestsRaisedForMe(RequestSearchCriteria searchCriteria, Set<String> retAttrs, HashMap<String,Object> configParams) throws RequestServiceException
      Gets list of all requests raised for the login user that matches the given search criteria.
      Parameters:
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      retAttrs - Request data which will be returned in Request Object. If the retAttrs is null or empty Set whole request data is returned in Request object.
      configParams - Additional configuration parameters for search results
      Returns:
      List of requests
      Throws:
      RequestServiceException - if fails to retrieve the requests from repository
    • getRequestsRaisedByMe

      List<Request> getRequestsRaisedByMe(RequestSearchCriteria searchCriteria, Set<String> retAttrs, HashMap<String,Object> configParams) throws RequestServiceException
      Gets list of all requests raised by login user that matches the given search criteria.
      Parameters:
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      retAttrs - Request data which will be returned in Request Object. If the retAttrs is null or empty Set whole request data is returned in Request object.
      configParams - Additional configuration parameters for search results
      Returns:
      List of requests
      Throws:
      RequestServiceException - if fails to retrieve requests from repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      List<Request> requests = reqsrvc.getRequestsRaisedByMe(searchCriteria,retAttrs,configParams)

    • getNumberOfRequestsRaisedForMe

      long getNumberOfRequestsRaisedForMe(RequestSearchCriteria searchCriteria) throws RequestServiceException
      Gets the count of requests raised for login user that match the given search criteria.
      Parameters:
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      Returns:
      Number of requests matched the given search criteria
      Throws:
      RequestServiceException - if fails to retrieve requests from repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      long numberOfRequests = reqsrvc.getNumberOfRequestsRaisedForMe(searchCriteria)

    • getRequestsForReportees

      List<Request> getRequestsForReportees(RequestSearchCriteria searchCriteria, Set<String> retAttrs, HashMap<String,Object> configParams) throws RequestServiceException
      Throws:
      RequestServiceException
    • getNumberOfRequestsRaisedByMe

      long getNumberOfRequestsRaisedByMe(RequestSearchCriteria searchCriteria) throws RequestServiceException
      Gets the count of requests raised by login user that matches the given search criteria.
      Parameters:
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      Returns:
      Number of requests matched the given search criteria
      Throws:
      RequestServiceException - if fails to retrieve requests from repository

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      long numberOfRequests = reqsrvc.getNumberOfRequestsRaisedByMe(searchCriteria)

    • getRequestsForUser

      List<Request> getRequestsForUser(String userKey, RequestSearchCriteria srchCrit, HashMap<String,Object> configParams) throws RequestServiceException
      Returns a list of requests raised for and raised by a specific user, that match the given search criteria. The logged in user must be a delegated admin and should have permission to view the requests of the user.
      Parameters:
      userKey - Mandatory parameter, of user key for which request search is done
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      configParams - Additional configuration parameters for search results
      Returns:
      List of requests

      Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates a search criteria with for revoke entitlement requests for a given entitlement Key "45668"
      RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
      searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.AND);
      searchCriteria.addExpression(RequestConstants.ENTITLEMENT_KEY_REMOVE_OPERATION,"45668",RequestSearchCriteria.Operator.EQUAL);

      //Creates additional search result configuration for sort order
      //Sort all the request object returned order by ascending of requestid
      Map <String, Object> config = new HashMap<String,Object>;
      config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
      config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

      //Search the requests based on the above criteria and config
      //returns an Request service instance
      RequestService reqsrvc = Platform.getService(RequestService.class);
      //gets a list of request
      List<Request> requests = reqsrvc.getRequestsForUser(userKey,searchCriteria,configParams)

      Throws:
      RequestServiceException
    • getCertificationRequests

      List<Request> getCertificationRequests(String certificationId, RequestSearchCriteria srchCrit, HashMap<String,Object> configParams) throws RequestServiceException
      Returns a list of requests raised as part of the certification review process, that match the given search criteria. The logged in user must have permission to view the certification with given Id.
      Parameters:
      certificationId - certification id.
      searchCriteria - Request search criteria

      Below is the list of allowed search parameters

      configParams - Additional configuration parameters for search results
      Returns:
      List of requests
      Throws:
      RequestServiceException
    • getRequestStageNames

      List<String> getRequestStageNames() throws RequestServiceException
      Gets all the request stage names defined in the system
      Returns:
      List of all the Request Stage names
      Throws:
      RequestServiceException - if fails to retrieve the request stage names from the repository
    • getRequestStages

      List<RequestStage> getRequestStages() throws RequestServiceException
      Gets all the request stages defined in the system
      Returns:
      List of all the Request Stage
      Throws:
      RequestServiceException - if fails to retrieve the request stage names from the repository
    • updateApproverOnlyData

      void updateApproverOnlyData(String reqId, List<RequestBeneficiaryEntity> benEntities, List<RequestEntity> reqEntities) throws RequestServiceException
      Deprecated.
      This method is replaced with updateRequestData
      Updates the request with approver only data. Only the current assignee of a task pending for the request can invoke this API.

      The arguments would be passed based on the request.
      benEntities would be passed only if request contains beneficiary(s), otherwise null.
      reqEntities would be passed only if request does not contain beneficiary(s), otherwise null

      Usage : Approver needs to follow a sequence of events to update the task.
      • If the task is assigned to a role using SOA APIs, approver needs to claim the task.
      • Approver needs update the task with approver only data.
      • Approver needs approve the task.
      Parameters:
      reqId -
      benEntities -
      reqEntities -
      Throws:
      RequestServiceException
    • updateRequestData

      void updateRequestData(String reqId, List<RequestBeneficiaryEntity> beneficiaryEntities, List<RequestEntity> entities) throws RequestServiceException, InvalidRequestDataException
      Updates the request with provided data.
        This API
      • can only be invoked as approver.
      • works for both single and bulk requests.
      • doens't support updating child data.

      Only the current assignee of a task pending for the request can invoke this API. The arguments would be passed based on the request type benEntities would be passed only if request contains beneficiary(s), otherwise null reqEntities would be passed only if request does not contain beneficiary(s), otherwise null

      Usage : Caller of this API needs to follow below sequence of events to update the Request.
      • If the task is assigned to a role using SOA APIs, approver needs to claim the task.
      • Approver needs update request with data.
      • Approver needs approve the task.
      Parameters:
      reqId - id of the request that needs to be updated.
      beneficiaryEntities - beneficiary entities with the updated data.
      entities - entities with updated data.
      Throws:
      RequestServiceException
      InvalidRequestDataException
    • getTemplateNamesForSelf

      @Deprecated List<String> getTemplateNamesForSelf() throws RequestServiceException
      Deprecated.
      Gets all the request template names for Self that the logged in user has access for request creation.
      Returns:
      List of all request template names for Self
      Throws:
      RequestServiceException - if it fails to get corresponding request model configurations
    • updateRequestStatus

      void updateRequestStatus(String requestID, String status) throws RequestServiceException
      Updates status of the Request given a request id.
      Parameters:
      Request - Id of the request whose status needs to be updated
      status - to which the request needs to be updated
      Throws:
      RequestServiceException
    • getRequestTemplates

      @Deprecated List<RequestTemplate> getRequestTemplates(oracle.iam.request.vo.RequestTemplateSearchCriteria searchCriteria, Set<String> returnAttrs, Map<String,Object> configParams) throws RequestServiceException
      Deprecated.
      Throws:
      RequestServiceException
    • deleteDraftRequest

      void deleteDraftRequest(String requestId) throws RequestServiceException
      Deletes the request given a request id. entire request data is deleted.
      Only draft request can be deleted
      Only requester can delete the request
      Parameters:
      requestId - The id of the draft request which needs to be deleted
      Throws:
      RequestServiceException - if it fails to delete the request or the request is not in draft state or the logged-in user is not requester
      or request id does not exist
    • saveDraftRequest

      String saveDraftRequest(RequestData requestData) throws RequestServiceException
      Creates the request in draft mode, request is not submitted for approval and request data is not validated
      Parameters:
      requestData - The request data which needs to be saved
      Returns:
      created request id
      Throws:
      RequestServiceException - if creation of draft request fails
    • updateDraftRequest

      void updateDraftRequest(String requestId, RequestData requestData) throws RequestServiceException
      Updates the draft request given a draft request id
      Parameters:
      requestId - The id of the draft request which needs to be updated
      requestData - The request data which needs to be updated
      Throws:
      RequestServiceException - if it fails to update the request successfully or the request is not in draft state
    • submitDraftRequest

      Submits the draft request given a draft request id , request data is validated
      Parameters:
      requestId - The id of the draft request which needs to be submitted
      requestData - The request data which needs to be submitted
      Throws:
      InvalidRequestException - if requestData does not have either Target entity or Beneficiary details as per request Model definition
      InvalidRequestDataException - if request data validation fails
      RequestServiceException - if it fails to update the draft request or fails due to authorization
      BulkBeneficiariesAddException
      BulkEntitiesAddException
    • getDependentRequests

      List<Request> getDependentRequests(String requestId) throws RequestServiceException, NoRequestPermissionException
      Returns the list of requests that depends on a particular request
      Parameters:
      requestId - The id of the request for which the list of dependents need to be returned
      Returns:
      List of dependent requests
      Throws:
      RequestServiceException - if the specified request id is invalid or fails to retrieve the request details from the repository
      NoRequestPermissionException - if the login user doesn't have permissions over the request
    • updateRequestData

      void updateRequestData(String reqId, List<RequestBeneficiaryEntity> beneficiaryEntities, List<RequestEntity> entities, List<RequestTemplateAttribute> additionalAttributes) throws RequestServiceException, InvalidRequestDataException
      Updates the request with provided data.
        This API
      • can only be invoked as approver.
      • works for both single and bulk requests.
      • doens't support updating child data.

      Only the current assignee of a task pending for the request can invoke this API. The arguments would be passed based on the request type benEntities would be passed only if request contains beneficiary(s), otherwise null reqEntities would be passed only if request does not contain beneficiary(s), otherwise null

      Usage : Caller of this API needs to follow below sequence of events to update the Request.
      • If the task is assigned to a role using SOA APIs, approver needs to claim the task.
      • Approver needs update request with data.
      • Approver needs approve the task.
      Parameters:
      reqId - id of the request that needs to be updated.
      beneficiaryEntities - beneficiary entities with the updated data.
      entities - entities with updated data.
      additionalAttributes - - additional/template attributes to be updated in the request.
      Throws:
      RequestServiceException
      InvalidRequestDataException