@Override public Comment addProcessCommentOnBehalfOfUser(final long processInstanceId, final String comment, long userId) throws CreationException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); try { tenantAccessor.getProcessInstanceService().getProcessInstance(processInstanceId); } catch (final SProcessInstanceReadException | SProcessInstanceNotFoundException e) { throw new RetrieveException(buildCantAddCommentOnProcessInstance(), e); // FIXME: should be another exception } final SCommentService commentService = tenantAccessor.getCommentService(); try { SComment sComment = commentService.addComment(processInstanceId, comment, userId); return ModelConvertor.toComment(sComment); } catch (final SBonitaException e) { throw new CreationException(buildCantAddCommentOnProcessInstance(), e.getCause()); } }
@Override public Comment addProcessCommentOnBehalfOfUser(final long processInstanceId, final String comment, long userId) throws CreationException { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); try { tenantAccessor.getProcessInstanceService().getProcessInstance(processInstanceId); } catch (final SProcessInstanceReadException | SProcessInstanceNotFoundException e) { throw new RetrieveException(buildCantAddCommentOnProcessInstance(), e); // FIXME: should be another exception } final SCommentService commentService = tenantAccessor.getCommentService(); try { SComment sComment = commentService.addComment(processInstanceId, comment, userId); return ModelConvertor.toComment(sComment); } catch (final SBonitaException e) { throw new CreationException(buildCantAddCommentOnProcessInstance(), e.getCause()); } }