Interface CategoryService

All Known Implementing Classes:
CategoryServiceImpl

public interface CategoryService
Since:
6.0
Author:
Yanyan Liu, Matthieu Chaffotte, Celine Souchet
  • Field Details

  • Method Details

    • createCategory

      Create a category by give name and description
      Parameters:
      name - The name of category
      description - The description of category
      Returns:
      the category object with id
      Throws:
      SCategoryAlreadyExistsException - Error thrown if category is already exist
      SCategoryCreationException - Error thrown if has exceptions during the category creation.
    • getCategory

      SCategory getCategory(long id) throws SCategoryNotFoundException
      Get category by its id
      Parameters:
      id - Identifier of the category
      Returns:
      a category object
      Throws:
      SCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.
    • getCategoryByName

      SCategory getCategoryByName(String name) throws SCategoryNotFoundException
      Get category by its name
      Parameters:
      name - Name of the category
      Returns:
      a category object
      Throws:
      SCategoryNotFoundException - Error thrown if no category have a name corresponding to the parameter.
    • updateCategory

      void updateCategory(long categoryId, EntityUpdateDescriptor descriptor) throws SCategoryNotFoundException, SCategoryException
      Update a category by its id
      Parameters:
      categoryId - Identifier of the category
      newCategory - An category object used to update the categoryId specified category
      Throws:
      SCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.
      SCategoryException - Error thrown if has exception during the category update
    • deleteCategory

      void deleteCategory(long categoryId) throws SCategoryNotFoundException, SCategoryDeletionException
      Delete a category by its id
      Parameters:
      categoryId - Identifier of the category
      Throws:
      SCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.
      SCategoryDeletionException - Error thrown if has exception during the category deletion
    • getNumberOfCategories

      long getNumberOfCategories() throws SCategoryException
      Get the total number of categories
      Returns:
      The total number of Categories
      Throws:
      SCategoryException
    • getCategories

      List<SCategory> getCategories(int fromIndex, int numberOfCategories, String field, OrderByType order) throws SPageOutOfRangeException, SCategoryException
      Retrieves a list of categories, The returned list is paginated
      Parameters:
      fromIndex - Index of the record to be returned. First record has index 0.
      numberOfCategories - Number of categories per page. Maximum number of categories returned.
      field - The field used by the list order
      order - ASC or DESC
      Returns:
      The list of category objects
      Throws:
      SPageOutOfRangeException - Error thrown if page is out of the range.
      SCategoryException - Error thrown if has exception during the category retrieve
    • addProcessDefinitionToCategory

      void addProcessDefinitionToCategory(long categoryId, long processDefinitionId) throws SCategoryNotFoundException, SCategoryInProcessAlreadyExistsException, SCategoryException
      Add a process definition to a category
      Parameters:
      categoryId - Identifier of the category
      processDefinitionId - Identifier of the process definition
      Throws:
      SCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.
      SCategoryException - Error thrown if has exception during the adding action
      SCategoryInProcessAlreadyExistsException
    • addProcessDefinitionsToCategory

      void addProcessDefinitionsToCategory(long categoryId, List<Long> processDefinitionIds) throws SCategoryNotFoundException, SCategoryException, SCategoryInProcessAlreadyExistsException
      Add process definitions to a category
      Parameters:
      categoryId - Identifier of the category
      processDefinitionIds - Identifier of the process definition
      Throws:
      SCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.
      SCategoryException - Error thrown if has exception during the adding action
      SCategoryInProcessAlreadyExistsException
    • getNumberOfCategoriesOfProcess

      long getNumberOfCategoriesOfProcess(long processDefinitionId) throws SCategoryException
      Get number of categories of the specific process definition
      Parameters:
      processDefinitionId - Identifier of the process definition
      Returns:
      number of categories
      Throws:
      SCategoryException - Error thrown if has exception during the category number retrieve action
    • getCategoriesOfProcessDefinition

      List<SCategory> getCategoriesOfProcessDefinition(long processId, int fromIndex, int numberOfCategories, OrderByType order) throws SCategoryException, SIndexOutOfRangeException
      Get categories for specific process definition, the result list is paginated
      Parameters:
      processId - Identifier of the process definition
      fromIndex - Start index of satisfied record
      numberOfCategories - Number of categories per page. Maximum number of categories returned.
      order - Criterion for order, default order by name
      Returns:
      The matching list of category
      Throws:
      SCategoryException - Error thrown if has exception during the category retrieve action
      SIndexOutOfRangeException - Error thrown if index is out of the range.
    • getNumberOfCategorizedProcessIds

      long getNumberOfCategorizedProcessIds(List<Long> processIds) throws SCategoryException
      Get number of categorized processes
      Parameters:
      processIds - Identifier of the process definition
      Returns:
      the number of categorized processes
      Throws:
      SCategoryException
    • getNumberOfProcessDeploymentInfosOfCategory

      long getNumberOfProcessDeploymentInfosOfCategory(long categoryId) throws SBonitaReadException
      Get the number of process definition for specific category
      Parameters:
      categoryId - Identifier of the category
      Returns:
      The number of process definition for specific category
      Throws:
      SCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.
      SCategoryException - Error thrown if has exception during the process definition id retrieve
      SBonitaReadException
    • removeCategoriesFromProcessDefinition

      void removeCategoriesFromProcessDefinition(long processId, List<Long> categoryIds) throws SCategoryException
      Remove specific categories for specific process definition
      Parameters:
      processId - Identifier of the process definition
      categoryIds - Identifiers of the categories
      Throws:
      SCategoryException
    • getCategoriesUnrelatedToProcessDefinition

      List<SCategory> getCategoriesUnrelatedToProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order) throws SCategoryException
      Get categories not attached for specific process definition, the result list is paginated
      Parameters:
      processDefinitionId -
      fromIndex -
      numberOfCategories -
      order -
      Returns:
      The matching list of category
      Throws:
      SCategoryException
    • getNumberOfCategoriesUnrelatedToProcess

      long getNumberOfCategoriesUnrelatedToProcess(long processDefinitionId) throws SCategoryException
      Get number of categories not attached of the specific process definition
      Parameters:
      processDefinitionId -
      Returns:
      number of categories
      Throws:
      SCategoryException - Error thrown if has exception during the category number retrieve action
    • searchProcessCategoryMappings

      List<SProcessCategoryMapping> searchProcessCategoryMappings(QueryOptions queryOptions) throws SBonitaReadException
      Search process category mappings corresponding to criteria
      Parameters:
      queryOptions -
      Returns:
      List of process category mappings
      Throws:
      SBonitaReadException
      Since:
      6.1
    • deleteProcessCategoryMappings

      long deleteProcessCategoryMappings(List<SProcessCategoryMapping> mappings)
      Parameters:
      mappings -
      Returns:
      Number of deleted category mapping
      Since:
      6.1