}
return result;
}
public CommentResponse createRestComment(Comment comment, String serverRootUrl) {
CommentResponse result = new CommentResponse();
result.setAuthor(comment.getUserId());
result.setMessage(comment.getFullMessage());
result.setId(comment.getId());
result.setTime(comment.getTime());
result.setTaskId(comment.getTaskId());
result.setProcessInstanceId(comment.getProcessInstanceId());
if (comment.getTaskId() != null) {
result.setTaskUrl(formatUrl(serverRootUrl, RestUrls.URL_TASK_COMMENT, comment.getTaskId(), comment.getId()));
}
if (comment.getProcessInstanceId() != null) {
result.setProcessInstanceUrl(formatUrl(serverRootUrl, RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, comment.getProcessInstanceId(), comment.getId()));
}
return result;
}