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."); } }
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 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); } }
public void deleteApplication(final long applicationId) throws DeletionException { try { applicationService.deleteApplication(applicationId); } catch (final SBonitaException e) { throw new DeletionException(e); } }
public void delete(final long id) throws DeletionException { try { service.deleteCustomUserInfoDefinition(id); } catch (SIdentityException e) { throw new DeletionException(e); } }
private void unregister(final DeleteSCommand deleteCommand) throws CommandNotFoundException, DeletionException { try { deleteCommand.execute(); } catch (final SCommandNotFoundException scnfe) { throw new CommandNotFoundException(scnfe); } catch (final SBonitaException sbe) { throw new DeletionException(sbe); } }
private void unregister(final DeleteSCommand deleteCommand) throws CommandNotFoundException, DeletionException { try { deleteCommand.execute(); } catch (final SCommandNotFoundException scnfe) { throw new CommandNotFoundException(scnfe); } catch (final SBonitaException sbe) { throw new DeletionException(sbe); } }
@Override public void deleteCategory(final long categoryId) throws DeletionException { if (categoryId <= 0) { throw new DeletionException("Category id can not be less than 0!"); } final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final CategoryService categoryService = tenantAccessor.getCategoryService(); final DeleteSCategory deleteSCategory = new DeleteSCategory(categoryService, categoryId); try { deleteSCategory.execute(); } catch (final SBonitaException sbe) { throw new DeletionException(sbe); } }
@Override public void unregisterAll() throws DeletionException { final CommandService commandService = getTenantAccessor().getCommandService(); try { commandService.deleteAll(); } catch (final SCommandDeletionException sde) { throw new DeletionException(sde); } }
public void deletePage(final long pageId) throws DeletionException { try { pageService.deletePage(pageId); final Set<Long> processDefinitionIds = updatePageMappings(pageId); for (final Long processDefinitionId : processDefinitionIds) { updateProcessResolution(processDefinitionId); } } catch (final SBonitaException e) { throw new DeletionException(e); } }
@Override public void deleteUserMembership(final long userMembershipId) throws DeletionException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final IdentityService identityService = tenantAccessor.getIdentityService(); try { identityService.deleteUserMembership(userMembershipId); } catch (final SIdentityException e) { throw new DeletionException(e); } }
public void deletePage(final long pageId) throws DeletionException { try { pageService.deletePage(pageId); final Set<Long> processDefinitionIds = updatePageMappings(pageId); for (final Long processDefinitionId : processDefinitionIds) { updateProcessResolution(processDefinitionId); } } catch (final SBonitaException e) { throw new DeletionException(e); } }
@Override public void deleteUserMembership(final long userMembershipId) throws DeletionException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final IdentityService identityService = tenantAccessor.getIdentityService(); try { identityService.deleteUserMembership(userMembershipId); } catch (final SIdentityException e) { throw new DeletionException(e); } }
@Override public void unregisterAll() throws DeletionException { final CommandService commandService = getTenantAccessor().getCommandService(); try { commandService.deleteAll(); } catch (final SCommandDeletionException sde) { throw new DeletionException(sde); } }
@Override public long deleteArchivedProcessInstances(final long processDefinitionId, final int startIndex, final int maxResults) throws DeletionException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ProcessInstanceService processInstanceService = tenantAccessor.getProcessInstanceService(); try { List<Long> sourceProcessInstanceIds = processInstanceService.getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(processDefinitionId, startIndex, maxResults, null); if (sourceProcessInstanceIds.isEmpty()) { return 0; } return deleteArchivedProcessInstancesInAllStates(sourceProcessInstanceIds); } catch (final SBonitaException e) { throw new DeletionException(e); } }
@Override public long deleteArchivedProcessInstances(final long processDefinitionId, final int startIndex, final int maxResults) throws DeletionException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ProcessInstanceService processInstanceService = tenantAccessor.getProcessInstanceService(); try { List<Long> sourceProcessInstanceIds = processInstanceService.getSourceProcessInstanceIdsOfArchProcessInstancesFromDefinition(processDefinitionId, startIndex, maxResults, null); if (sourceProcessInstanceIds.isEmpty()) { return 0; } return deleteArchivedProcessInstancesInAllStates(sourceProcessInstanceIds); } catch (final SBonitaException e) { throw new DeletionException(e); } }
@Override public long deleteArchivedProcessInstancesInAllStates(final List<Long> sourceProcessInstanceIds) throws DeletionException { if (sourceProcessInstanceIds == null || sourceProcessInstanceIds.isEmpty()) { throw new IllegalArgumentException("The identifier of the archived process instances to deleted are missing !!"); } final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ProcessInstanceService processInstanceService = tenantAccessor.getProcessInstanceService(); try { return processInstanceService.deleteArchivedProcessInstances(sourceProcessInstanceIds); } catch (final SProcessInstanceHierarchicalDeletionException e) { throw new ProcessInstanceHierarchicalDeletionException(e.getMessage(), e.getProcessInstanceId()); } catch (final SBonitaException e) { throw new DeletionException(e); } }
@Override public void removeCategoriesFromProcess(final long processDefinitionId, final List<Long> categoryIds) throws DeletionException { try { final CategoryService categoryService = getTenantAccessor().getCategoryService(); final TransactionContent transactionContent = new RemoveCategoriesFromProcessDefinition(processDefinitionId, categoryIds, categoryService); transactionContent.execute(); } catch (final SBonitaException sbe) { throw new DeletionException(sbe); } }
@Override public void unregister(final String name) throws CommandNotFoundException, DeletionException { if (name == null) { // FIXME: throw IllegalArgumentException instead, and make bonita interceptor catch all exceptions and wrap it into BonitaRuntimeException: throw new DeletionException("Command name can not be null!"); } final CommandService commandService = getTenantAccessor().getCommandService(); final DeleteSCommand deleteCommand = new DeleteSCommand(commandService, name); unregister(deleteCommand); }