Interface CategoryService
- All Known Implementing Classes:
CategoryServiceImpl
public interface CategoryService
- Since:
- 6.0
- Author:
- Yanyan Liu, Matthieu Chaffotte, Celine Souchet
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessDefinitionsToCategory(long categoryId, List<Long> processDefinitionIds) Add process definitions to a categoryvoidaddProcessDefinitionToCategory(long categoryId, long processDefinitionId) Add a process definition to a categorycreateCategory(String name, String description) Create a category by give name and descriptionvoiddeleteCategory(long categoryId) Delete a category by its idlonggetCategories(int fromIndex, int numberOfCategories, String field, OrderByType order) Retrieves a list of categories, The returned list is paginatedgetCategoriesOfProcessDefinition(long processId, int fromIndex, int numberOfCategories, OrderByType order) Get categories for specific process definition, the result list is paginatedgetCategoriesUnrelatedToProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order) Get categories not attached for specific process definition, the result list is paginatedgetCategory(long id) Get category by its idgetCategoryByName(String name) Get category by its namelongGet the total number of categorieslonggetNumberOfCategoriesOfProcess(long processDefinitionId) Get number of categories of the specific process definitionlonggetNumberOfCategoriesUnrelatedToProcess(long processDefinitionId) Get number of categories not attached of the specific process definitionlonggetNumberOfCategorizedProcessIds(List<Long> processIds) Get number of categorized processeslonggetNumberOfProcessDeploymentInfosOfCategory(long categoryId) Get the number of process definition for specific categoryvoidremoveCategoriesFromProcessDefinition(long processId, List<Long> categoryIds) Remove specific categories for specific process definitionsearchProcessCategoryMappings(QueryOptions queryOptions) Search process category mappings corresponding to criteriavoidupdateCategory(long categoryId, EntityUpdateDescriptor descriptor) Update a category by its id
-
Field Details
-
CATEGORY
- See Also:
-
-
Method Details
-
createCategory
SCategory createCategory(String name, String description) throws SCategoryAlreadyExistsException, SCategoryCreationException Create a category by give name and description- Parameters:
name- The name of categorydescription- The description of category- Returns:
- the category object with id
- Throws:
SCategoryAlreadyExistsException- Error thrown if category is already existSCategoryCreationException- Error thrown if has exceptions during the category creation.
-
getCategory
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
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 categorynewCategory- 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
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
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 orderorder- 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 categoryprocessDefinitionId- 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 actionSCategoryInProcessAlreadyExistsException
-
addProcessDefinitionsToCategory
void addProcessDefinitionsToCategory(long categoryId, List<Long> processDefinitionIds) throws SCategoryNotFoundException, SCategoryException, SCategoryInProcessAlreadyExistsException Add process definitions to a category- Parameters:
categoryId- Identifier of the categoryprocessDefinitionIds- 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 actionSCategoryInProcessAlreadyExistsException
-
getNumberOfCategoriesOfProcess
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 definitionfromIndex- Start index of satisfied recordnumberOfCategories- 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 actionSIndexOutOfRangeException- Error thrown if index is out of the range.
-
getNumberOfCategorizedProcessIds
Get number of categorized processes- Parameters:
processIds- Identifier of the process definition- Returns:
- the number of categorized processes
- Throws:
SCategoryException
-
getNumberOfProcessDeploymentInfosOfCategory
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 retrieveSBonitaReadException
-
removeCategoriesFromProcessDefinition
void removeCategoriesFromProcessDefinition(long processId, List<Long> categoryIds) throws SCategoryException Remove specific categories for specific process definition- Parameters:
processId- Identifier of the process definitioncategoryIds- Identifiers of the categories- Throws:
SCategoryException
-
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
- Parameters:
mappings-- Returns:
- Number of deleted category mapping
- Since:
- 6.1
-