@Deprecated @Override public List<Comment> getComments(final long processInstanceId) { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final SCommentService commentService = tenantAccessor.getCommentService(); try { final List<SComment> sComments = commentService.getComments(processInstanceId); return ModelConvertor.toComments(sComments); } catch (final SBonitaReadException sbe) { throw new RetrieveException(sbe); } }
@Deprecated @Override public List<Comment> getComments(final long processInstanceId) { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final SCommentService commentService = tenantAccessor.getCommentService(); try { final List<SComment> sComments = commentService.getComments(processInstanceId); return ModelConvertor.toComments(sComments); } catch (final SBonitaReadException sbe) { throw new RetrieveException(sbe); } }
private void archiveComments(final SProcessDefinition processDefinition, final SProcessInstance processInstance, final SCommentService commentService, final long archiveDate) throws SArchivingException { try { List<SComment> sComments; int startIndex = 0; do { sComments = commentService .getComments(processInstance.getId(), new QueryOptions(startIndex, BATCH_SIZE, SComment.class, "id", OrderByType.ASC)); for (final SComment sComment : sComments) { commentService.archive(archiveDate, sComment); } startIndex += BATCH_SIZE; } while (!sComments.isEmpty()); } catch (final SBonitaException e) { setExceptionContext(processDefinition, processInstance, e); throw new SArchivingException("Unable to archive the process instance comments.", e); } }
private void archiveComments(final SProcessDefinition processDefinition, final SProcessInstance processInstance, final SCommentService commentService, final long archiveDate) throws SArchivingException { try { List<SComment> sComments; int startIndex = 0; do { sComments = commentService .getComments(processInstance.getId(), new QueryOptions(startIndex, BATCH_SIZE, SComment.class, "id", OrderByType.ASC)); for (final SComment sComment : sComments) { commentService.archive(archiveDate, sComment); } startIndex += BATCH_SIZE; } while (!sComments.isEmpty()); } catch (final SBonitaException e) { setExceptionContext(processDefinition, processInstance, e); throw new SArchivingException("Unable to archive the process instance comments.", e); } }