@Override public SProfile whenProfileExists(final long importerId, final ProfileNode profile, final SProfile existingProfile) throws ExecutionException { throw new ExecutionException("There's a same name profile when import a profile named " + profile.getName()); }
@Override public SProfile whenProfileExists(final long importerId, final ProfileNode profile, final SProfile existingProfile) throws ExecutionException { throw new ExecutionException("There's a same name profile when import a profile named " + profile.getName()); }
public String exportAllProfiles() throws ExecutionException { try { ArrayList<SProfile> sProfiles = getAllProfiles(); ProfilesNode profiles = toProfiles(sProfiles); return profilesParser.convert(profiles); } catch (SBonitaException | JAXBException e) { throw new ExecutionException(e); } }
public String exportProfiles(List<Long> longs) throws ExecutionException { try { List<SProfile> sProfile = profileService.getProfiles(longs); ProfilesNode profiles = toProfiles(sProfile); return profilesParser.convert(profiles); } catch (SBonitaException | JAXBException e) { throw new ExecutionException(e); } }
public String exportAllProfiles() throws ExecutionException { try { ArrayList<SProfile> sProfiles = getAllProfiles(); ProfilesNode profiles = toProfiles(sProfiles); return profilesParser.convert(profiles); } catch (SBonitaException | JAXBException e) { throw new ExecutionException(e); } }
public String exportProfiles(List<Long> longs) throws ExecutionException { try { List<SProfile> sProfile = profileService.getProfiles(longs); ProfilesNode profiles = toProfiles(sProfile); return profilesParser.convert(profiles); } catch (SBonitaException | JAXBException e) { throw new ExecutionException(e); } }
@Override public void executeMessageCouple(final long messageInstanceId, final long waitingMessageId) throws ExecutionException { MessagesHandlingService messagesHandlingService = getTenantAccessor().getMessagesHandlingService(); try { messagesHandlingService.resetMessageCouple(messageInstanceId, waitingMessageId); messagesHandlingService.triggerMatchingOfMessages(); } catch (SBonitaException e) { throw new ExecutionException( "Failed to execute Event Message couple: messageInstanceId=" + messageInstanceId + ", waitingMessageId=" + waitingMessageId, e); } }
@Override public void replayFailedJob(final long jobDescriptorId, final Map<String, Serializable> parameters) throws ExecutionException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final SchedulerService schedulerService = tenantAccessor.getSchedulerService(); try { if (parameters == null || parameters.isEmpty()) { schedulerService.executeAgain(jobDescriptorId); } else { final List<SJobParameter> jobParameters = getJobParameters(parameters); schedulerService.executeAgain(jobDescriptorId, jobParameters); } } catch (final SSchedulerException sse) { throw new ExecutionException(sse); } }
@Override public void replayFailedJob(final long jobDescriptorId, final Map<String, Serializable> parameters) throws ExecutionException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final SchedulerService schedulerService = tenantAccessor.getSchedulerService(); try { if (parameters == null || parameters.isEmpty()) { schedulerService.executeAgain(jobDescriptorId); } else { final List<SJobParameter> jobParameters = getJobParameters(parameters); schedulerService.executeAgain(jobDescriptorId, jobParameters); } } catch (final SSchedulerException sse) { throw new ExecutionException(sse); } }
@Override public boolean checkAPICallWithScript(String className, APICallContext context, boolean reload) throws ExecutionException, NotFoundException { TenantServiceAccessor serviceAccessor = getTenantServiceAccessor(); PermissionService permissionService = serviceAccessor.getPermissionService(); try { return permissionService.checkAPICallWithScript(className, context, reload); } catch (SExecutionException e) { throw new ExecutionException("Unable to execute the security rule " + className + " for the api call " + context, e); } catch (ClassNotFoundException e) { throw new NotFoundException("Unable to execute the security rule " + className + " for the api call " + context + "because the class " + className + " is not found", e); } }
@Override public void executeMessageCouple(final long messageInstanceId, final long waitingMessageId) throws ExecutionException { MessagesHandlingService messagesHandlingService = getTenantAccessor().getMessagesHandlingService(); try { messagesHandlingService.resetMessageCouple(messageInstanceId, waitingMessageId); messagesHandlingService.triggerMatchingOfMessages(); } catch (SBonitaException e) { throw new ExecutionException( "Failed to execute Event Message couple: messageInstanceId=" + messageInstanceId + ", waitingMessageId=" + waitingMessageId, e); } }
@Override public void beforeImport() throws ExecutionException { final QueryOptions queryOptions = new QueryOptions(0, 100, Collections.singletonList(new OrderByOption(SProfile.class, SProfileBuilderFactory.NAME, OrderByType.ASC)), Collections.<FilterOption> emptyList(), null); // delete all profiles try { List<SProfile> profiles; do { profiles = getProfileService().searchProfiles(queryOptions); for (final SProfile sProfile : profiles) { getProfileService().deleteProfile(sProfile); } } while (!profiles.isEmpty()); } catch (final SBonitaException e) { throw new ExecutionException(e); } }
@Override public void beforeImport() throws ExecutionException { final QueryOptions queryOptions = new QueryOptions(0, 100, Collections.singletonList(new OrderByOption(SProfile.class, SProfileBuilderFactory.NAME, OrderByType.ASC)), Collections.<FilterOption> emptyList(), null); // delete all profiles try { List<SProfile> profiles; do { profiles = getProfileService().searchProfiles(queryOptions); for (final SProfile sProfile : profiles) { getProfileService().deleteProfile(sProfile); } } while (!profiles.isEmpty()); } catch (final SBonitaException e) { throw new ExecutionException(e); } }
@Override public boolean checkAPICallWithScript(String className, APICallContext context, boolean reload) throws ExecutionException, NotFoundException { TenantServiceAccessor serviceAccessor = getTenantServiceAccessor(); PermissionService permissionService = serviceAccessor.getPermissionService(); try { return permissionService.checkAPICallWithScript(className, context, reload); } catch (SExecutionException e) { throw new ExecutionException("Unable to execute the security rule " + className + " for the api call " + context, e); } catch (ClassNotFoundException e) { throw new NotFoundException("Unable to execute the security rule " + className + " for the api call " + context + "because the class " + className + " is not found", 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); } }
@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); } }
throw new ExecutionException(e);
throw new ExecutionException(e);