public class CategoryServiceImpl extends java.lang.Object implements CategoryService
CATEGORY| Constructor and Description |
|---|
CategoryServiceImpl(ReadPersistenceService persistenceService,
Recorder recorder,
EventService eventService,
SessionService sessionService,
ReadSessionAccessor sessionAccessor,
QueriableLoggerService queriableLoggerService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessDefinitionsToCategory(long categoryId,
java.util.List<java.lang.Long> processDefinitionIds)
Add process definitions to a category
|
void |
addProcessDefinitionToCategory(long categoryId,
long processDefinitionId)
Add a process definition to a category
|
SCategory |
createCategory(java.lang.String name,
java.lang.String description)
Create a category by give name and description
|
void |
deleteCategory(long categoryId)
Delete a category by its id
|
long |
deleteProcessCategoryMappings(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 paginated
|
java.util.List<SCategory> |
getCategoriesOfProcessDefinition(long processDefinitionId,
int fromIndex,
int numberOfCategories,
OrderByType order)
Get categories for specific process definition, the result list is paginated
|
java.util.List<SCategory> |
getCategoriesUnrelatedToProcessDefinition(long processDefinitionId,
int fromIndex,
int numberOfCategories,
OrderByType order)
Get categories not attached for specific process definition, the result list is paginated
|
SCategory |
getCategory(long id)
Get category by its id
|
SCategory |
getCategoryByName(java.lang.String name)
Get category by its name
|
long |
getNumberOfCategories()
Get the total number of categories
|
long |
getNumberOfCategoriesOfProcess(long processDefinitionId)
Get number of categories of the specific process definition
|
long |
getNumberOfCategoriesUnrelatedToProcess(long processDefinitionId)
Get number of categories not attached of the specific process definition
|
long |
getNumberOfCategorizedProcessIds(java.util.List<java.lang.Long> processIds)
Get number of categorized processes
|
long |
getNumberOfProcessDeploymentInfosOfCategory(long categoryId)
Get the number of process definition for specific category
|
void |
removeCategoriesFromProcessDefinition(long processDefinitionId,
java.util.List<java.lang.Long> categoryIds)
Remove specific categories for specific process definition
|
java.util.List<SProcessCategoryMapping> |
searchProcessCategoryMappings(QueryOptions queryOptions)
Search process category mappings corresponding to criteria
|
void |
updateCategory(long categoryId,
EntityUpdateDescriptor descriptor)
Update a category by its id
|
public CategoryServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, SessionService sessionService, ReadSessionAccessor sessionAccessor, QueriableLoggerService queriableLoggerService)
public SCategory createCategory(java.lang.String name, java.lang.String description) throws SCategoryAlreadyExistsException, SCategoryCreationException
CategoryServicecreateCategory in interface CategoryServicename - The name of categorydescription - The description of categorySCategoryAlreadyExistsException - Error thrown if category is already existSCategoryCreationException - Error thrown if has exceptions during the category creation.public SCategory getCategory(long id) throws SCategoryNotFoundException
CategoryServicegetCategory in interface CategoryServiceid - Identifier of the categorySCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.public SCategory getCategoryByName(java.lang.String name) throws SCategoryNotFoundException
CategoryServicegetCategoryByName in interface CategoryServicename - Name of the categorySCategoryNotFoundException - Error thrown if no category have a name corresponding to the parameter.public void updateCategory(long categoryId,
EntityUpdateDescriptor descriptor)
throws SCategoryException
CategoryServiceupdateCategory in interface CategoryServicecategoryId - Identifier of the categorySCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.SCategoryException - Error thrown if has exception during the category updatepublic void deleteCategory(long categoryId)
throws SCategoryNotFoundException,
SCategoryDeletionException
CategoryServicedeleteCategory in interface CategoryServicecategoryId - Identifier of the categorySCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.SCategoryDeletionException - Error thrown if has exception during the category deletionpublic long getNumberOfCategories()
throws SCategoryException
CategoryServicegetNumberOfCategories in interface CategoryServiceSCategoryExceptionpublic java.util.List<SCategory> getCategories(int fromIndex, int numberOfCategories, java.lang.String field, OrderByType order) throws SCategoryException
CategoryServicegetCategories in interface CategoryServicefromIndex - 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 DESCSPageOutOfRangeException - Error thrown if page is out of the range.SCategoryException - Error thrown if has exception during the category retrievepublic void addProcessDefinitionToCategory(long categoryId,
long processDefinitionId)
throws SCategoryException
CategoryServiceaddProcessDefinitionToCategory in interface CategoryServicecategoryId - Identifier of the categoryprocessDefinitionId - Identifier of the process definitionSCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.SCategoryException - Error thrown if has exception during the adding actionpublic void addProcessDefinitionsToCategory(long categoryId,
java.util.List<java.lang.Long> processDefinitionIds)
throws SCategoryException
CategoryServiceaddProcessDefinitionsToCategory in interface CategoryServicecategoryId - Identifier of the categoryprocessDefinitionIds - Identifier of the process definitionSCategoryNotFoundException - Error thrown if no category have an id corresponding to the parameter.SCategoryException - Error thrown if has exception during the adding actionSCategoryInProcessAlreadyExistsExceptionpublic long getNumberOfCategoriesOfProcess(long processDefinitionId)
throws SCategoryException
CategoryServicegetNumberOfCategoriesOfProcess in interface CategoryServiceprocessDefinitionId - Identifier of the process definitionSCategoryException - Error thrown if has exception during the category number retrieve actionpublic long getNumberOfCategoriesUnrelatedToProcess(long processDefinitionId)
throws SCategoryException
CategoryServicegetNumberOfCategoriesUnrelatedToProcess in interface CategoryServiceSCategoryException - Error thrown if has exception during the category number retrieve actionpublic java.util.List<SCategory> getCategoriesOfProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order) throws SCategoryException
CategoryServicegetCategoriesOfProcessDefinition in interface CategoryServiceprocessDefinitionId - 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 nameSCategoryException - Error thrown if has exception during the category retrieve actionSIndexOutOfRangeException - Error thrown if index is out of the range.public java.util.List<SCategory> getCategoriesUnrelatedToProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order) throws SCategoryException
CategoryServicegetCategoriesUnrelatedToProcessDefinition in interface CategoryServiceSCategoryExceptionpublic void removeCategoriesFromProcessDefinition(long processDefinitionId,
java.util.List<java.lang.Long> categoryIds)
throws SCategoryException
CategoryServiceremoveCategoriesFromProcessDefinition in interface CategoryServiceprocessDefinitionId - Identifier of the process definitioncategoryIds - Identifiers of the categoriesSCategoryExceptionpublic java.util.List<SProcessCategoryMapping> searchProcessCategoryMappings(QueryOptions queryOptions) throws SBonitaReadException
CategoryServicesearchProcessCategoryMappings in interface CategoryServiceSBonitaReadExceptionpublic long deleteProcessCategoryMappings(java.util.List<SProcessCategoryMapping> mappings)
deleteProcessCategoryMappings in interface CategoryServicepublic long getNumberOfCategorizedProcessIds(java.util.List<java.lang.Long> processIds)
throws SCategoryException
CategoryServicegetNumberOfCategorizedProcessIds in interface CategoryServiceprocessIds - Identifier of the process definitionSCategoryExceptionpublic long getNumberOfProcessDeploymentInfosOfCategory(long categoryId)
throws SBonitaReadException
CategoryServicegetNumberOfProcessDeploymentInfosOfCategory in interface CategoryServicecategoryId - Identifier of the categorySBonitaReadException