Search in sources :

Example 1 with CommentResponse

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;
}
Also used : CommentResponse(org.activiti.rest.service.api.engine.CommentResponse) Comment(org.activiti.engine.task.Comment) ArrayList(java.util.ArrayList)

Example 2 with CommentResponse

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;
}
Also used : CommentResponse(org.activiti.rest.service.api.engine.CommentResponse)

Aggregations

CommentResponse (org.activiti.rest.service.api.engine.CommentResponse)2 ArrayList (java.util.ArrayList)1 Comment (org.activiti.engine.task.Comment)1