@Override public List<SActor> getActors(final Set<Long> scopeIds, final Long userId) throws SBonitaReadException { final SelectListDescriptor<SActor> descriptor = SelectDescriptorBuilder.getFullActorsListOfUser(scopeIds, userId); return persistenceService.selectList(descriptor); }
@Override public List<SActor> getActors(final long processDefinitionId, final QueryOptions queryOptions) throws SBonitaReadException { final SelectListDescriptor<SActor> descriptor = SelectDescriptorBuilder.getActorsOfScope(processDefinitionId, queryOptions); return persistenceService.selectList(descriptor); }
@Override public List<SActorMember> getActorMembers(final long actorId, final int fromIndex, final int numberOfActorMembers) throws SBonitaReadException { final SelectListDescriptor<SActorMember> descriptor = SelectDescriptorBuilder.getActorMembers(actorId, fromIndex, numberOfActorMembers); return persistenceService.selectList(descriptor); }
@Override public List<SProcessDefinitionDeployInfo> getProcessDeploymentInfos(final QueryOptions queryOptions) throws SBonitaReadException { return persistenceService.selectList(new SelectListDescriptor<SProcessDefinitionDeployInfo>("getProcessDefinitionDeployInfos", Collections .<String, Object> emptyMap(), SProcessDefinitionDeployInfo.class, queryOptions)); }
@Override public List<SProcessDefinitionDeployInfo> getProcessDeploymentInfosWithActorOnlyForGroup(final long groupId, final QueryOptions queryOptions) throws SBonitaReadException { final Map<String, Object> parameters = Collections.singletonMap(GROUP_ID, (Object) groupId); final SelectListDescriptor<SProcessDefinitionDeployInfo> selectDescriptor = new SelectListDescriptor<>( "getProcessesWithActorOnlyForGroup", parameters, SProcessDefinitionDeployInfo.class, queryOptions); return persistenceService.selectList(selectDescriptor); }
@Override public List<SProcessDefinitionDeployInfo> getProcessDeploymentInfosWithActorOnlyForUsers(final List<Long> userIds, final QueryOptions queryOptions) throws SBonitaReadException { final Map<String, Object> parameters = Collections.singletonMap("userIds", (Object) userIds); final SelectListDescriptor<SProcessDefinitionDeployInfo> selectDescriptor = new SelectListDescriptor<>( "getProcessesWithActorOnlyForUsers", parameters, SProcessDefinitionDeployInfo.class, queryOptions); return persistenceService.selectList(selectDescriptor); }
@Override public SMappedDocument getMappedDocument(final long processInstanceId, final String documentName, final long time) throws SObjectNotFoundException, SBonitaReadException { final List<SAMappedDocument> docMapping = definitiveArchiveReadPersistenceService.selectList(SelectDescriptorBuilder .getSAMappedDocumentOfProcessWithName( processInstanceId, documentName, time)); if (docMapping.isEmpty()) { return getMappedDocument(processInstanceId, documentName); } return docMapping.get(0); }
@Override public List<Long> getArchivedChildrenSourceObjectIdsFromRootProcessInstance(final long rootProcessInstanceId, final int fromIndex, final int maxResults, final OrderByType sortingOrder) throws SBonitaReadException { final Map<String, Object> inputParameters = new HashMap<>(1); inputParameters.put("rootProcessInstanceId", rootProcessInstanceId); final QueryOptions queryOptions = new QueryOptions(fromIndex, maxResults, SAProcessInstance.class, "sourceObjectId", sortingOrder); final SelectListDescriptor<Long> selectListDescriptor = new SelectListDescriptor<>("getChildrenSourceProcessInstanceIdsFromRootProcessInstance", inputParameters, SAProcessInstance.class, queryOptions); return persistenceRead.selectList(selectListDescriptor); }
@Override public List<SProcessDefinitionDeployInfo> getProcessDeploymentInfosUnrelatedToCategory(final long categoryId, final int pageIndex, final int numberPerPage, final ProcessDeploymentInfoCriterion pagingCriterion) throws SBonitaReadException { final Map<String, Object> parameters = Collections.singletonMap("categoryId", (Object) categoryId); final QueryOptions queryOptions = createQueryOptions(pageIndex, numberPerPage, pagingCriterion); final SelectListDescriptor<SProcessDefinitionDeployInfo> selectDescriptor = new SelectListDescriptor<>( "searchSProcessDefinitionDeployInfoUnrelatedToCategory", parameters, SProcessDefinitionDeployInfo.class, queryOptions); return persistenceService.selectList(selectDescriptor); }
@Deprecated @Override public List<SComment> getComments(final long processInstanceId) throws SBonitaReadException { final Map<String, Object> parameters = Collections.singletonMap("processInstanceId", (Object) processInstanceId); final OrderByOption orderByOption = new OrderByOption(SComment.class, "id", OrderByType.ASC); final QueryOptions queryOptions = new QueryOptions(Arrays.asList(orderByOption)); final SelectListDescriptor<SComment> selectDescriptor = new SelectListDescriptor<SComment>("getSComments", parameters, SComment.class, queryOptions); return persistenceService.selectList(selectDescriptor); }
@Override public List<SUser> getUsersWithRole(final long roleId, final int fromIndex, final int numberOfUsers) throws SIdentityException { try { return persistenceService.selectList(SelectDescriptorBuilder.getUsersWithRole(roleId, fromIndex, numberOfUsers)); } catch (final SBonitaReadException e) { throw new SIdentityException("Can't get the users having the role " + roleId, e); } }
@Override public List<SUser> getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException { try { return persistenceService.selectList(SelectDescriptorBuilder.getActiveUsersWithRole(roleId, fromIndex, numberOfUsers)); } catch (final SBonitaReadException e) { throw new SIdentityException("Can't get the active users having the role " + roleId, e); } }
@Override public List<SUser> getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException { try { return persistenceService.selectList(SelectDescriptorBuilder.getInactiveUsersWithRole(roleId, fromIndex, numberOfUsers)); } catch (final SBonitaReadException e) { throw new SIdentityException("Can't get the inactive users having the role " + roleId, e); } }
@Override public List<SUserMembership> getUserMembershipsOfUser(final long userId, final int fromIndex, final int numberOfMemberships, final String field, final OrderByType order) throws SIdentityException { try { final SelectListDescriptor<SUserMembership> descriptor = SelectDescriptorBuilder.getUserMembershipsOfUser(userId, field, order, fromIndex, numberOfMemberships); return persistenceService.selectList(descriptor); } catch (final SBonitaReadException e) { throw new SIdentityException("Can't get the memberships having the user" + userId, e); } }
@Override public List<STenantResource> get(TenantResourceType type, int from, int numberOfElements) throws SBonitaReadException { Map<String, Object> inputParameters = new HashMap<>(); inputParameters.put("type", type); return persistenceService.selectList( new SelectListDescriptor<STenantResource>("getTenantResourcesOfType", inputParameters, STenantResource.class, new QueryOptions(from, numberOfElements))); }
@Override public List<SCategory> getCategories(final int fromIndex, final int numberOfCategories, final String field, final OrderByType order) throws SCategoryException { final SelectListDescriptor<SCategory> descriptor = SelectDescriptorBuilder.getCategories(field, order, fromIndex, numberOfCategories); try { return persistenceService.selectList(descriptor); } catch (final SBonitaReadException e) { throw new SCategoryException(e); } }
@Override public List<SCategory> getCategoriesUnrelatedToProcessDefinition(final long processDefinitionId, final int fromIndex, final int numberOfCategories, final OrderByType order) throws SCategoryException { final SelectListDescriptor<SCategory> descriptor = SelectDescriptorBuilder.getCategoriesUnrelatedToProcess(processDefinitionId, fromIndex, numberOfCategories, order); try { return persistenceService.selectList(descriptor); } catch (final SBonitaReadException e) { throw new SCategoryException(e); } }
@Override public List<String> getAllPagesForProfile(final long profileId) throws SBonitaReadException { final SelectListDescriptor<String> selectList = new SelectListDescriptor<String>("getAllPagesForProfile", Collections.<String, Object> singletonMap( "profileId", profileId), SApplicationPage.class, new QueryOptions(0, QueryOptions.UNLIMITED_NUMBER_OF_RESULTS)); return persistenceService.selectList(selectList); } @Override
@Override public List<SUserMembership> getUserMembershipsOfUser(final long userId, final int fromIndex, final int numberPerPage, final OrderByOption orderByOption) throws SIdentityException { try { final SelectListDescriptor<SUserMembership> descriptor = SelectDescriptorBuilder.getUserMembershipsOfUser(userId, new QueryOptions(fromIndex, numberPerPage, Collections.singletonList(orderByOption))); return persistenceService.selectList(descriptor); } catch (final SBonitaReadException e) { throw new SIdentityException("Can't get the memberships having the user" + userId, e); } }
@Override public List<SParameter> get(long processDefinitionId, int fromIndex, int numberOfResult, OrderBy order) throws SBonitaReadException { return persistenceService.selectList( new SelectListDescriptor<>("getParameters", Collections.singletonMap(PROCESS_DEFINITION_ID_KEY, processDefinitionId), SParameter.class, new QueryOptions(fromIndex, numberOfResult, getOrderByOptions(order)))); }