use of org.activiti.rest.service.api.engine.CommentResponse in project Activiti by Activiti.
the class RestResponseFactory method createRestCommentList.
public List<CommentResponse> createRestCommentList(List<Comment> comments) {
RestUrlBuilder urlBuilder = createUrlBuilder();
List<CommentResponse> responseList = new ArrayList<CommentResponse>();
for (Comment instance : comments) {
responseList.add(createRestComment(instance, urlBuilder));
}
return responseList;
}
use of org.activiti.rest.service.api.engine.CommentResponse in project Activiti by Activiti.
the class RestResponseFactory method createRestComment.
public CommentResponse createRestComment(Comment comment, RestUrlBuilder urlBuilder) {
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(urlBuilder.buildUrl(RestUrls.URL_TASK_COMMENT, comment.getTaskId(), comment.getId()));
}
if (comment.getProcessInstanceId() != null) {
result.setProcessInstanceUrl(urlBuilder.buildUrl(RestUrls.URL_HISTORIC_PROCESS_INSTANCE_COMMENT, comment.getProcessInstanceId(), comment.getId()));
}
return result;
}
Aggregations