Interface CategoryService
-
- All Known Implementing Classes:
CategoryServiceImpl
public interface CategoryService- Since:
- 6.0
- Author:
- Yanyan Liu, Matthieu Chaffotte, Celine Souchet
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCATEGORY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddProcessDefinitionsToCategory(long categoryId, java.util.List<java.lang.Long> processDefinitionIds)Add process definitions to a categoryvoidaddProcessDefinitionToCategory(long categoryId, long processDefinitionId)Add a process definition to a categorySCategorycreateCategory(java.lang.String name, java.lang.String description)Create a category by give name and descriptionvoiddeleteCategory(long categoryId)Delete a category by its idlongdeleteProcessCategoryMappings(java.util.List<SProcessCategoryMapping> mappings)java.util.List<SCategory>getCategories(int fromIndex, int numberOfCategories, java.lang.String field, OrderByType order)Retrieves a list of categories, The returned list is paginatedjava.util.List<SCategory>getCategoriesOfProcessDefinition(long processId, int fromIndex, int numberOfCategories, OrderByType order)Get categories for specific process definition, the result list is paginatedjava.util.List<SCategory>getCategoriesUnrelatedToProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order)Get categories not attached for specific process definition, the result list is paginatedSCategorygetCategory(long id)Get category by its idSCategorygetCategoryByName(java.lang.String name)Get category by its namelonggetNumberOfCategories()Get 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(java.util.List<java.lang.Long> processIds)Get number of categorized processeslonggetNumberOfProcessDeploymentInfosOfCategory(long categoryId)Get the number of process definition for specific categoryvoidremoveCategoriesFromProcessDefinition(long processId, java.util.List<java.lang.Long> categoryIds)Remove specific categories for specific process definitionjava.util.List<SProcessCategoryMapping>searchProcessCategoryMappings(QueryOptions queryOptions)Search process category mappings corresponding to criteriavoidupdateCategory(long categoryId, EntityUpdateDescriptor descriptor)Update a category by its id
-
-
-
Field Detail
-
CATEGORY
static final java.lang.String CATEGORY
- See Also:
- Constant Field Values
-
-
Method Detail
-
createCategory
SCategory createCategory(java.lang.String name, java.lang.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
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(java.lang.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, SCategoryExceptionUpdate 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
void deleteCategory(long categoryId) throws SCategoryNotFoundException, SCategoryDeletionExceptionDelete 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 SCategoryExceptionGet the total number of categories- Returns:
- The total number of Categories
- Throws:
SCategoryException
-
getCategories
java.util.List<SCategory> getCategories(int fromIndex, int numberOfCategories, java.lang.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, SCategoryExceptionAdd 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, java.util.List<java.lang.Long> processDefinitionIds) throws SCategoryNotFoundException, SCategoryException, SCategoryInProcessAlreadyExistsExceptionAdd 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
long getNumberOfCategoriesOfProcess(long processDefinitionId) throws SCategoryExceptionGet 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
java.util.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
long getNumberOfCategorizedProcessIds(java.util.List<java.lang.Long> processIds) throws SCategoryExceptionGet 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 SBonitaReadExceptionGet 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, java.util.List<java.lang.Long> categoryIds) throws SCategoryExceptionRemove specific categories for specific process definition- Parameters:
processId- Identifier of the process definitioncategoryIds- Identifiers of the categories- Throws:
SCategoryException
-
getCategoriesUnrelatedToProcessDefinition
java.util.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 SCategoryExceptionGet 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
java.util.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(java.util.List<SProcessCategoryMapping> mappings)
- Parameters:
mappings-- Returns:
- Number of deleted category mapping
- Since:
- 6.1
-
-