use of org.wso2.carbon.bpmn.rest.model.runtime.CommentResponseCollection in project carbon-business-process by wso2.
the class HistoricProcessInstanceService method getComments.
@GET
@Path("/{processInstanceId}/comments")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getComments(@PathParam("processInstanceId") String processInstanceId) {
TaskService taskService = BPMNOSGIService.getTaskService();
HistoricProcessInstance instance = getHistoricProcessInstanceFromRequest(processInstanceId);
List<CommentResponse> commentResponseList = new RestResponseFactory().createRestCommentList(taskService.getProcessInstanceComments(instance.getId()), uriInfo.getBaseUri().toString());
CommentResponseCollection commentResponseCollection = new CommentResponseCollection();
commentResponseCollection.setCommentResponseList(commentResponseList);
return Response.ok().entity(commentResponseCollection).build();
}
use of org.wso2.carbon.bpmn.rest.model.runtime.CommentResponseCollection in project carbon-business-process by wso2.
the class WorkflowTaskService method getComments.
@GET
@Path("/{taskId}/comments")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response getComments(@PathParam("taskId") String taskId) {
HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
TaskService taskService = BPMNOSGIService.getTaskService();
List<CommentResponse> commentResponseList = new RestResponseFactory().createRestCommentList(taskService.getTaskComments(task.getId()), uriInfo.getBaseUri().toString());
CommentResponseCollection commentResponseCollection = new CommentResponseCollection();
commentResponseCollection.setCommentResponseList(commentResponseList);
return Response.ok().entity(commentResponseCollection).build();
}
Aggregations