@Override public <T> T lookup(final String serviceName) throws NotFoundException { try { return beanAccessor.getService(serviceName); } catch (NoSuchBeanDefinitionException e) { throw new NotFoundException(e); } }
@Override public <T> T lookup(String serviceName) throws NotFoundException { try{ return beanAccessor.getService(serviceName); }catch (NoSuchBeanDefinitionException e) { throw new NotFoundException(e); } }
@Override public <T> T lookup(final String serviceName) throws NotFoundException { try { return beanAccessor.getService(serviceName); } catch (NoSuchBeanDefinitionException e) { throw new NotFoundException(e); } }
@Override public <T> T lookup(String serviceName) throws NotFoundException { try{ return beanAccessor.getService(serviceName); }catch (NoSuchBeanDefinitionException e) { throw new NotFoundException(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 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 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 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 Icon getIcon(long id) throws NotFoundException { try { SIcon icon = getTenantAccessor().getIdentityService().getIcon(id); if (icon == null) { throw new NotFoundException("unable to find icon with id " + id); } return ModelConvertor.toIcon(icon); } catch (SBonitaReadException e) { throw new RetrieveException(e); } }
@Override public Icon getIcon(long id) throws NotFoundException { try { SIcon icon = getTenantAccessor().getIdentityService().getIcon(id); if (icon == null) { throw new NotFoundException("unable to find icon with id " + id); } return ModelConvertor.toIcon(icon); } catch (SBonitaReadException e) { throw new RetrieveException(e); } }
@Override public ArchivedComment getArchivedComment(final long archivedCommentId) throws RetrieveException, NotFoundException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final SCommentService sCommentService = tenantAccessor.getCommentService(); try { final SAComment archivedComment = sCommentService.getArchivedComment(archivedCommentId); return ModelConvertor.toArchivedComment(archivedComment); } catch (final SCommentNotFoundException e) { throw new NotFoundException(e); } catch (final SBonitaException e) { throw new RetrieveException(e); } }
@Override public ArchivedComment getArchivedComment(final long archivedCommentId) throws RetrieveException, NotFoundException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final SCommentService sCommentService = tenantAccessor.getCommentService(); try { final SAComment archivedComment = sCommentService.getArchivedComment(archivedCommentId); return ModelConvertor.toArchivedComment(archivedComment); } catch (final SCommentNotFoundException e) { throw new NotFoundException(e); } catch (final SBonitaException e) { throw new RetrieveException(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); } }
public ParameterInstance getParameterInstance(final long processDefinitionId, final String parameterName) throws NotFoundException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ParameterService parameterService = tenantAccessor.getParameterService(); final ProcessDefinitionService processDefinitionService = tenantAccessor.getProcessDefinitionService(); try { final SProcessDefinition sProcessDefinition = getServerProcessDefinition(processDefinitionId, processDefinitionService); final SParameter parameter = parameterService.get(processDefinitionId, parameterName); if (parameter == null) { throw new NotFoundException("the parameter with name " + parameterName + " and process with id " + processDefinitionId + " was not found."); } final String name = parameter.getName(); final String value = parameter.getValue(); final SParameterDefinition parameterDefinition = sProcessDefinition.getParameter(name); final String description = parameterDefinition.getDescription(); final String type = parameterDefinition.getType(); return new ParameterImpl(name, description, value, type); } catch (final SBonitaException e) { throw new RetrieveException(e); } }
public ParameterInstance getParameterInstance(final long processDefinitionId, final String parameterName) throws NotFoundException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ParameterService parameterService = tenantAccessor.getParameterService(); final ProcessDefinitionService processDefinitionService = tenantAccessor.getProcessDefinitionService(); try { final SProcessDefinition sProcessDefinition = getServerProcessDefinition(processDefinitionId, processDefinitionService); final SParameter parameter = parameterService.get(processDefinitionId, parameterName); if (parameter == null) { throw new NotFoundException("the parameter with name " + parameterName + " and process with id " + processDefinitionId + " was not found."); } final String name = parameter.getName(); final String value = parameter.getValue(); final SParameterDefinition parameterDefinition = sProcessDefinition.getParameter(name); final String description = parameterDefinition.getDescription(); final String type = parameterDefinition.getType(); return new ParameterImpl(name, description, value, type); } catch (final SBonitaException e) { throw new RetrieveException(e); } }