@Override public List<STheme> searchThemes(final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = Collections.emptyMap(); return persistenceService.searchEntity(STheme.class, queryOptions, parameters); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long getNumberOfCustomUserInfoValue(final QueryOptions options) throws SBonitaReadException { try { return persistenceService.getNumberOfEntities(SCustomUserInfoValue.class, options, null); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long getNumberOfCustomUserInfoValue(final QueryOptions options) throws SBonitaReadException { try { return persistenceService.getNumberOfEntities(SCustomUserInfoValue.class, options, null); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long executeCount(final QueryOptions queryOptions) throws SBonitaReadException { try { return pageService.getNumberOfPages(queryOptions); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long getNumberOfOpenProcessInstancesInvolvingUser(final long userId, final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = new HashMap<>(1); parameters.put(USER_ID, userId); return persistenceRead.getNumberOfEntities(SProcessInstance.class, INVOLVING_USER, queryOptions, parameters); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public List<SProcessInstance> searchOpenProcessInstancesSupervisedBy(final long userId, final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = Collections.singletonMap(USER_ID, (Object) userId); return persistenceRead.searchEntity(SProcessInstance.class, SUPERVISED_BY, queryOptions, parameters); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public void loadLeftOperandInContext(final SLeftOperand sLeftOperand,final long leftOperandContainerId, final String leftOperandContainerType, final SExpressionContext expressionContext) throws SBonitaReadException { try { putInContext(sLeftOperand,leftOperandContainerId,leftOperandContainerType, expressionContext); } catch (final SDataInstanceException e) { throw new SBonitaReadException("Unable to retrieve the data", e); } }
@Override public long executeCount(final QueryOptions queryOptions) throws SBonitaReadException { try { return pageService.getNumberOfPages(queryOptions); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long getNumberOfCommentsSupervisedBy(final long supervisorId, final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = Collections.singletonMap("supervisorId", (Object) supervisorId); return persistenceService.getNumberOfEntities(SComment.class, SUPERVISED_BY, queryOptions, parameters); } catch (final SBonitaReadException bre) { throw new SBonitaReadException(bre); } }
@Override public long getNumberOfFailedProcessInstancesSupervisedBy(final long userId, final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = Collections.singletonMap(USER_ID, (Object) userId); return persistenceRead.getNumberOfEntities(SProcessInstance.class, FAILED_AND_SUPERVISED_BY, queryOptions, parameters); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public List<SProcessInstance> searchFailedProcessInstancesSupervisedBy(final long userId, final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = Collections.singletonMap(USER_ID, (Object) userId); return persistenceRead.searchEntity(SProcessInstance.class, FAILED_AND_SUPERVISED_BY, queryOptions, parameters); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long getNumberOfOpenProcessInstancesInvolvingUser(final long userId, final QueryOptions queryOptions) throws SBonitaReadException { try { final Map<String, Object> parameters = new HashMap<>(1); parameters.put(USER_ID, userId); return persistenceRead.getNumberOfEntities(SProcessInstance.class, INVOLVING_USER, queryOptions, parameters); } catch (final SBonitaReadException e) { throw new SBonitaReadException(e); } }
@Override public long getNumberOfArchivedProcessInstancesInvolvingUser(final long userId, final QueryOptions countOptions) throws SBonitaReadException { final ReadPersistenceService persistenceService = archiveService.getDefinitiveArchiveReadPersistenceService(); try { final Map<String, Object> parameters = new HashMap<>(2); parameters.put(USER_ID, userId); return persistenceService.getNumberOfEntities(SAProcessInstance.class, INVOLVING_USER, countOptions, parameters); } catch (final SBonitaReadException bre) { throw new SBonitaReadException(bre); } }
private void validateActivityTypeFilterUnicity(SearchOptions searchOptions) throws SBonitaReadException { for (final SearchFilter searchFilter : searchOptions.getFilters()) { if (ActivityInstanceSearchDescriptor.ACTIVITY_TYPE.equals(searchFilter.getField())) { throw new SBonitaReadException("Invalid query, filtering several times on 'ActivityInstanceSearchDescriptor.ACTIVITY_TYPE' is not supported."); } } }
private ActorMapping getActorMappingFromXML(String xmlContent) throws SBonitaException { byte[] b = xmlContent.getBytes(); try { return new ActorMappingMarshaller().deserializeFromXML(b); } catch (XmlMarshallException e) { throw new SBonitaReadException("Unable to read the actor mapping xml", e); } }
private ActorMapping getActorMappingFromXML(String xmlContent) throws SBonitaException { byte[] b = xmlContent.getBytes(); try { return new ActorMappingMarshaller().deserializeFromXML(b); } catch (XmlMarshallException e) { throw new SBonitaReadException("Unable to read the actor mapping xml", e); } }
@Override public <T> T selectOne(final SelectOneDescriptor<T> selectDescriptor) throws SBonitaReadException { try { return selectOne(getSession(true), selectDescriptor); } catch (final SPersistenceException e) { throw new SBonitaReadException(e, selectDescriptor); } }
private SDataInstance retrieve(final SLeftOperand sLeftOperand, final Long containerId, final String containerType) throws SBonitaReadException { try { return transientDataService.getDataInstance(sLeftOperand.getName(), containerId, containerType); } catch (final SDataInstanceException e) { throw new SBonitaReadException("Unable to read the transient data", e); } }
private void handleAutoLoginConfiguration(SProcessDefinition sProcessDefinition) throws SBonitaReadException { AutoLoginConfigurationHelper autoLoginConfigurationHelper = new AutoLoginConfigurationHelper(configurationService, tenantId, sProcessDefinition); try { final SBARResource sbarResource = processResourcesService.get(processId, BARResourceType.EXTERNAL, RESOURCES_FORMS_SECURITY_CONFIG_PROPERTIES); if (sbarResource != null) { autoLoginConfigurationHelper.enableAutoLogin(getPropertiesFromBarResource(sbarResource)); } } catch (IOException | SProcessEnablementException e) { throw new SBonitaReadException(e); } }
public OrderByOption getEntityOrder(final Sort sort) throws SBonitaReadException { final FieldDescriptor fieldDescriptor = getEntityKeys().get(sort.getField()); if (fieldDescriptor == null) { throw new SBonitaReadException("Invalid sort key: " + sort.getField()); } final OrderByType type = OrderByType.valueOf(sort.getOrder().name()); return new OrderByOption(fieldDescriptor.getPersistentClass(), fieldDescriptor.getValue(), type); }