@Override public void deleteOrganization() throws DeletionException { final OrganizationAPIImpl organizationAPIImpl = new OrganizationAPIImpl(getTenantAccessor(), 100); organizationAPIImpl.deleteOrganization(); }
private void deleteCustomUserInfo(IdentityService identityService) throws SIdentityException { // only definitions will be deleted because values are deleted on cascade from DB List<SCustomUserInfoDefinition> customUserInfoDefinitions; do { // the start index is always zero because the current page will be deleted customUserInfoDefinitions = identityService.getCustomUserInfoDefinitions(0, pageSize); deleteCustomUserInfo(customUserInfoDefinitions, identityService); } while (customUserInfoDefinitions.size() == pageSize); }
public void deleteOrganization() throws DeletionException { final ProcessInstanceService processInstanceService = tenantAccessor.getProcessInstanceService(); final SCommentService commentService = tenantAccessor.getCommentService(); final ActivityInstanceService activityInstanceService = tenantAccessor.getActivityInstanceService(); try { final QueryOptions queryOptions = new QueryOptions(0, 1); boolean canDeleteOrganization = processInstanceService.getNumberOfProcessInstances(queryOptions) == 0 && activityInstanceService.getNumberOfHumanTasks(queryOptions) == 0 && commentService.getNumberOfComments(queryOptions) == 0; if (canDeleteOrganization) { deleteOrganizationElements(activityInstanceService); updateActorProcessDependenciesForAllActors(tenantAccessor); } else { throw new DeletionException("Can't delete a organization when a process, a human tasks, or a comment is active !!."); } } catch (final SBonitaException e) { throw new DeletionException(e); } }
public void deleteOrganization() throws DeletionException { final ProcessInstanceService processInstanceService = tenantAccessor.getProcessInstanceService(); final SCommentService commentService = tenantAccessor.getCommentService(); final ActivityInstanceService activityInstanceService = tenantAccessor.getActivityInstanceService(); try { final QueryOptions queryOptions = new QueryOptions(0, 1); boolean canDeleteOrganization = processInstanceService.getNumberOfProcessInstances(queryOptions) == 0 && activityInstanceService.getNumberOfHumanTasks(queryOptions) == 0 && commentService.getNumberOfComments(queryOptions) == 0; if (canDeleteOrganization) { deleteOrganizationElements(activityInstanceService); updateActorProcessDependenciesForAllActors(tenantAccessor); } else { throw new DeletionException("Can't delete a organization when a process, a human tasks, or a comment is active !!."); } } catch (final SBonitaException e) { throw new DeletionException(e); } }
@Override public void deleteOrganization() throws DeletionException { final OrganizationAPIImpl organizationAPIImpl = new OrganizationAPIImpl(getTenantAccessor(), 100); organizationAPIImpl.deleteOrganization(); }
private void deleteCustomUserInfo(IdentityService identityService) throws SIdentityException { // only definitions will be deleted because values are deleted on cascade from DB List<SCustomUserInfoDefinition> customUserInfoDefinitions; do { // the start index is always zero because the current page will be deleted customUserInfoDefinitions = identityService.getCustomUserInfoDefinitions(0, pageSize); deleteCustomUserInfo(customUserInfoDefinitions, identityService); } while (customUserInfoDefinitions.size() == pageSize); }
private void deleteOrganizationElements(final ActivityInstanceService activityInstanceService) throws SBonitaException { final IdentityService identityService = tenantAccessor.getIdentityService(); final ActorMappingService actorMappingService = tenantAccessor.getActorMappingService(); final ProfileService profileService = tenantAccessor.getProfileService(); final SupervisorMappingService supervisorService = tenantAccessor.getSupervisorService(); final ExternalIdentityMappingService externalIdentityMappingService = tenantAccessor.getExternalIdentityMappingService(); deleteCustomUserInfo(identityService); actorMappingService.deleteAllActorMembers(); profileService.deleteAllProfileMembers(); activityInstanceService.deleteAllPendingMappings(); supervisorService.deleteAllProcessSupervisors(); externalIdentityMappingService.deleteAllExternalIdentityMappings(); identityService.deleteAllUserMemberships(); identityService.deleteAllGroups(); identityService.deleteAllRoles(); identityService.deleteAllUsers(); }
private void deleteOrganizationElements(final ActivityInstanceService activityInstanceService) throws SBonitaException { final IdentityService identityService = tenantAccessor.getIdentityService(); final ActorMappingService actorMappingService = tenantAccessor.getActorMappingService(); final ProfileService profileService = tenantAccessor.getProfileService(); final SupervisorMappingService supervisorService = tenantAccessor.getSupervisorService(); final ExternalIdentityMappingService externalIdentityMappingService = tenantAccessor.getExternalIdentityMappingService(); deleteCustomUserInfo(identityService); actorMappingService.deleteAllActorMembers(); profileService.deleteAllProfileMembers(); activityInstanceService.deleteAllPendingMappings(); supervisorService.deleteAllProcessSupervisors(); externalIdentityMappingService.deleteAllExternalIdentityMappings(); identityService.deleteAllUserMemberships(); identityService.deleteAllGroups(); identityService.deleteAllRoles(); identityService.deleteAllUsers(); }