private void checkIfItIsPossibleToDeleteProcessInstance(final long processDefinitionId, final boolean canThrowException) throws DeletionException { if (canThrowException) { throw new DeletionException("Some active process instances are still found, process #" + processDefinitionId + " can't be deleted."); } }
protected BonitaRuntimeException wrapThrowable(final Throwable cause) { return new BonitaRuntimeException(cause); }
public NotSerializableException(final String connectorDefinitionId, final String connectorDefinitionVersion, final String key, final Object value) { super(createMessage(connectorDefinitionId, connectorDefinitionVersion, key, value)); }
private InvalidPageZipContentException convertException(final SInvalidPageZipException e) { if (e instanceof SInvalidPageZipMissingPropertiesException) { return new InvalidPageZipMissingPropertiesException(); } if (e instanceof SInvalidPageZipMissingAPropertyException) { return new InvalidPageZipMissingAPropertyException(((SInvalidPageZipMissingAPropertyException) e).getFields()); } if (e instanceof SInvalidPageZipInconsistentException) { return new InvalidPageZipInconsistentException(e.getMessage(), e); } if (e instanceof SInvalidPageZipMissingIndexException) { return new InvalidPageZipMissingIndexException(); } return new InvalidPageZipContentException(e.getMessage(), e); }
@Override public PageURL resolvePageOrURL(String key, Map<String, Serializable> context, boolean executeAuthorizationRules) throws NotFoundException, ExecutionException, UnauthorizedAccessException { final PageMappingService pageMappingService = retrievePageMappingService(); try { return ModelConvertor.toPageURL(pageMappingService.resolvePageURL(pageMappingService.get(key), context, executeAuthorizationRules)); } catch (final SObjectNotFoundException e) { throw new NotFoundException(e); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SExecutionException e) { throw new ExecutionException(e); } catch (final SAuthorizationException e) { throw new UnauthorizedAccessException(e); } }
public Page createPage(final String contentName, final byte[] content) throws AlreadyExistsException, CreationException, InvalidPageTokenException, InvalidPageZipContentException { try { return convertToPage(pageService.addPage(content, contentName, userIdFromSession)); } catch (final SObjectAlreadyExistsException e) { throw new AlreadyExistsException("A page already exists with the name defined in page zip content"); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw convertException(e); } catch (final SBonitaException e) { throw new CreationException(e); } }
@Override public HumanTaskInstance getLastStateHumanTaskInstance(final long rootProcessInstanceId, final String taskName) throws NotFoundException { try { final List<HumanTaskInstance> humanTaskInstances = getHumanTaskInstances(rootProcessInstanceId, taskName, 0, 1, HumanTaskInstanceSearchDescriptor.REACHED_STATE_DATE, Order.DESC); if (humanTaskInstances == null || humanTaskInstances.isEmpty()) { throw new NotFoundException("Task '" + taskName + "' not found"); } return humanTaskInstances.get(0); } catch (final SearchException e) { throw new RetrieveException(e); } }
public List<String> getAllPagesForProfile(final long profileId) { try { return applicationService.getAllPagesForProfile(profileId); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } } public List<String> getAllPagesForProfile(String profile) {
public SearchFilter(final SearchFilterOperation operation) throws IncorrectParameterException { this.operation = operation; if (!isUndefinedFieldNameAuthorized()) { throw new IncorrectParameterException( "search operator can only be AND, OR, L_PARENTHESIS, R_PARENTHESIS on the one-parameter SearchFilter constructor"); } }
protected BonitaRuntimeException wrapThrowable(final Throwable cause) { return new BonitaRuntimeException(cause); }
private InvalidPageZipContentException convertException(final SInvalidPageZipException e) { if (e instanceof SInvalidPageZipMissingPropertiesException) { return new InvalidPageZipMissingPropertiesException(); } if (e instanceof SInvalidPageZipMissingAPropertyException) { return new InvalidPageZipMissingAPropertyException(((SInvalidPageZipMissingAPropertyException) e).getFields()); } if (e instanceof SInvalidPageZipInconsistentException) { return new InvalidPageZipInconsistentException(e.getMessage(), e); } if (e instanceof SInvalidPageZipMissingIndexException) { return new InvalidPageZipMissingIndexException(); } return new InvalidPageZipContentException(e.getMessage(), e); }
@Override public PageURL resolvePageOrURL(String key, Map<String, Serializable> context, boolean executeAuthorizationRules) throws NotFoundException, ExecutionException, UnauthorizedAccessException { final PageMappingService pageMappingService = retrievePageMappingService(); try { return ModelConvertor.toPageURL(pageMappingService.resolvePageURL(pageMappingService.get(key), context, executeAuthorizationRules)); } catch (final SObjectNotFoundException e) { throw new NotFoundException(e); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SExecutionException e) { throw new ExecutionException(e); } catch (final SAuthorizationException e) { throw new UnauthorizedAccessException(e); } }
public Page createPage(final String contentName, final byte[] content) throws AlreadyExistsException, CreationException, InvalidPageTokenException, InvalidPageZipContentException { try { return convertToPage(pageService.addPage(content, contentName, userIdFromSession)); } catch (final SObjectAlreadyExistsException e) { throw new AlreadyExistsException("A page already exists with the name defined in page zip content"); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage(), e); } catch (final SInvalidPageZipException e) { throw convertException(e); } catch (final SBonitaException e) { throw new CreationException(e); } }
@Override public HumanTaskInstance getLastStateHumanTaskInstance(final long rootProcessInstanceId, final String taskName) throws NotFoundException { try { final List<HumanTaskInstance> humanTaskInstances = getHumanTaskInstances(rootProcessInstanceId, taskName, 0, 1, HumanTaskInstanceSearchDescriptor.REACHED_STATE_DATE, Order.DESC); if (humanTaskInstances == null || humanTaskInstances.isEmpty()) { throw new NotFoundException("Task '" + taskName + "' not found"); } return humanTaskInstances.get(0); } catch (final SearchException e) { throw new RetrieveException(e); } }
@Override public List<Long> getUserIdsForActor(final long processDefinitionId, final String actorName, final int startIndex, final int maxResults) { try { return getUserIdsForActor(getTenantAccessor(), processDefinitionId, actorName, startIndex, maxResults); } catch (final SBonitaException e) { throw new RetrieveException(e); } }
private void checkIfItIsPossibleToDeleteProcessInstance(final long processDefinitionId, final boolean canThrowException) throws DeletionException { if (canThrowException) { throw new DeletionException("Some active process instances are still found, process #" + processDefinitionId + " can't be deleted."); } }
public NotSerializableException(final String connectorDefinitionId, final String connectorDefinitionVersion, final String key, final Object value) { super(createMessage(connectorDefinitionId, connectorDefinitionVersion, key, value)); }
private static PlatformServiceAccessor getPlatformServiceAccessor() throws RetrieveException { try { return ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); } catch (final Exception e) { throw new RetrieveException(e); } }
public void delete(final long id) throws DeletionException { try { service.deleteCustomUserInfoDefinition(id); } catch (SIdentityException e) { throw new DeletionException(e); } }
public void deleteApplication(final long applicationId) throws DeletionException { try { applicationService.deleteApplication(applicationId); } catch (final SBonitaException e) { throw new DeletionException(e); } }